-
-
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.10.0-dev.2083+13d1798ea
Steps to Reproduce
run zig test phantomErrorTrace.zig
// phantomErrorTrace.zig
const std = @import("std");
fn alwaysErrors() !void {
return error.BUG_ThisErrorShouldNotAppearInAnyTrace;
}
test "test expected error" {
try std.testing.expectError(error.BUG_ThisErrorShouldNotAppearInAnyTrace, alwaysErrors());
}
test "trigger error trace" {
return error.WeExpectToSeeThisInTheTrace;
}
Expected Behavior
should only see error trace for the second test
1/2 test "test expected error"... OK
2/2 test "trigger error trace"... FAIL (WeExpectToSeeThisInTheTrace)
FAIL (WeExpectToSeeThisInTheTrace)
/Users/daniel/Developer/zigtests/phantomerrortrace.zig:14:5: 0x1005a992f in test "trigger error trace" (test)
return error.WeExpectToSeeThisInTheTrace;
^
1 passed; 0 skipped; 1 failed.
Actual Behavior
Error trace from the first test appears in the error trace for the second test
1/2 test "test expected error"... OK
2/2 test "trigger error trace"... FAIL (WeExpectToSeeThisInTheTrace)
FAIL (WeExpectToSeeThisInTheTrace)
/Users/daniel/Developer/zigtests/phantomerrortrace.zig:6:5: 0x10085dce7 in alwaysErrors (test)
return error.BUG_ThisErrorShouldNotAppearInAnyTrace;
^
/Users/daniel/Developer/zigtests/phantomerrortrace.zig:14:5: 0x10085cd3b in test "trigger error trace" (test)
return error.WeExpectToSeeThisInTheTrace;
^
1 passed; 0 skipped; 1 failed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior