testing: Avoid printing expected line twice

When the line has trailing whitespace we already print it with a
carriage return symbol at the end, don't print it one more time.
This commit is contained in:
LemonBoy 2021-04-09 10:39:13 +02:00 committed by Andrew Kelley
parent 1943c2dc68
commit b0e905a30d

View File

@ -439,7 +439,7 @@ fn printWithVisibleNewlines(source: []const u8) void {
fn printLine(line: []const u8) void {
if (line.len != 0) switch (line[line.len - 1]) {
' ', '\t' => print("{s}⏎\n", .{line}), // Carriage return symbol,
' ', '\t' => return print("{s}⏎\n", .{line}), // Carriage return symbol,
else => {},
};
print("{s}\n", .{line});