aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2021-04-09 10:39:13 +0200
committerAndrew Kelley <andrew@ziglang.org>2021-04-09 10:04:16 -0700
commitb0e905a30dc99928c6686bf2b1401bebc0b0bdc0 (patch)
treee781b7a45c61b6438ee4f504f10bcf447085d2ea /lib/std/testing.zig
parent1943c2dc687ecb2dcc818ea5c1e8edb9544849fe (diff)
downloadzig-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.zig2
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});