diff options
| author | LemonBoy <thatlemon@gmail.com> | 2021-04-09 10:39:13 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-09 10:04:16 -0700 |
| commit | b0e905a30dc99928c6686bf2b1401bebc0b0bdc0 (patch) | |
| tree | e781b7a45c61b6438ee4f504f10bcf447085d2ea /lib/std/testing.zig | |
| parent | 1943c2dc687ecb2dcc818ea5c1e8edb9544849fe (diff) | |
| download | zig-b0e905a30dc99928c6686bf2b1401bebc0b0bdc0.tar.gz zig-b0e905a30dc99928c6686bf2b1401bebc0b0bdc0.zip | |
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 (limited to 'lib/std/testing.zig')
| -rw-r--r-- | lib/std/testing.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 02947216e3..f2bd26fbcf 100644 --- 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}); |
