-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.11.0-dev.2969+855493bb8
Steps to Reproduce and Observed Behavior
const std = @import("std");
pub fn main() void {}
test {
std.debug.print("\nNew line!\n", .{});
return error.ThisIsAnError;
}
Put this in a blank zig project and run zig build test
. This causes this output:
run test: error: 'test_0' failed: New line!
/home/emma/zig-bugs/newline/src/main.zig:7:5: 0x20efe9 in test_0 (test)
return error.ThisIsAnError;
^
run test: error: m
First, the leading newline before the message is stripped, and second an erroneous run test: error: m
is printed.
Expected Behavior
Expected an output like this:
run test: error: 'test_0' failed:
New line!
/home/emma/zig-bugs/newline/src/main.zig:7:5: 0x20efe9 in test_0 (test)
return error.ThisIsAnError;
^
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior