-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Milestone
Description
Zig Version
0.10.0-dev.450+63ee6e662
Steps to Reproduce
- Create a test file with the following contents.
const std = @import("std");
pub fn add(x: i32, y: i32) i32 {
return x + y;
}
test "basic test" {
try std.testing.expectEqual(10, 3 + 7);
}
test "Test should fail" {
try std.testing.expectEqual(add(5, 5), 15);
}
- Run the test file
zig test test.zig
Expected Behavior
Test runner should show the correct test number when the test fails.
Example:
Test [2/2] test "Test should fail"... expected 10, found 15
Test [2/2] test "Test should fail"... FAIL (TestExpectedEqual)
Actual Behavior
Test [1/2] test "Test should fail"... expected 10, found 15
Test [2/2] test "Test should fail"... FAIL (TestExpectedEqual)
/usr/lib/zig/std/testing.zig:79:17: 0x20801f in std.testing.expectEqual (test)
return error.TestExpectedEqual;
^
/home/kenobi/code/sterling/src/test.zig:8:5: 0x207a8f in test "Test should fail" (test)
try std.testing.expectEqual(5 + 5, 15);
^
1 passed; 0 skipped; 1 failed.
error: the following test command failed with exit code 1:
src/zig-cache/o/193861cd31ad5908c0ceb539270824aa/test /usr/bin/zig
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior