mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:47:46 +00:00
headless-browser: Write failed diffs in unified format with context
This commit is contained in:
parent
2c9db2de05
commit
ff23426b6e
1 changed files with 5 additions and 5 deletions
|
@ -254,12 +254,12 @@ static ErrorOr<TestResult> run_test(HeadlessWebContentView& view, StringView inp
|
|||
else
|
||||
outln("\nTest failed: {}", input_path);
|
||||
|
||||
auto hunks = TRY(Diff::from_text(expectation, actual));
|
||||
auto hunks = TRY(Diff::from_text(expectation, actual, 3));
|
||||
auto out = TRY(Core::File::standard_output());
|
||||
for (auto const& hunk : hunks) {
|
||||
TRY(out->write_formatted("Hunk: "));
|
||||
TRY(Diff::write_normal(hunk, *out, color_output));
|
||||
}
|
||||
|
||||
TRY(Diff::write_unified_header(expectation_path, expectation_path, *out));
|
||||
for (auto const& hunk : hunks)
|
||||
TRY(Diff::write_unified(hunk, *out, color_output));
|
||||
|
||||
return TestResult::Fail;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue