Commit b0e905a30d

LemonBoy <thatlemon@gmail.com>
2021-04-09 10:39:13
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.
1 parent 1943c2d
Changed files (1)
lib
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});