1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

headless-browser: Improve output for failing tests a bit

- Colorize the "Test failed" part when stdout is a TTY
- Add missing newlines in the output
This commit is contained in:
Andreas Kling 2023-06-12 11:51:28 +02:00
parent 1696411f66
commit b86ca27692

View file

@ -243,7 +243,10 @@ static ErrorOr<TestResult> run_test(HeadlessWebContentView& view, StringView inp
bool color_output = isatty(STDOUT_FILENO);
dbgln("Test failed: {}", input_path);
if (color_output)
outln("\n\033[33;1mTest failed\033[0m: {}", input_path);
else
outln("\nTest failed: {}", input_path);
auto hunks = Diff::from_text(expectation, actual);
for (auto const& hunk : hunks) {