zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b0e905a30dc99928c6686bf2b1401bebc0b0bdc0 (tree)
parent 1943c2dc687ecb2dcc818ea5c1e8edb9544849fe
Author: LemonBoy <thatlemon@gmail.com>
Date:   Fri,  9 Apr 2021 10:39:13 +0200

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.

Diffstat:
Mlib/std/testing.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/testing.zig b/lib/std/testing.zig @@ -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});