Open Rexicon226 opened 1 year ago
I confirmed the same issue is present in 0.11.0
.
After trying this in 0.12.0-dev.4+e7ba4b7f9
, I can see that the issue is still there.
https://github.com/ziglang/zig/issues/15091 possibly relevant
So this will fix the issue.
Now tests like:
test "Example Test" {
std.debug.print("{d}", .{1});
}
Run like this:
Test [1/1] test.Example Test... 1
All 1 tests passed.
Which in my opinion is the best option.
Having two tests runs like this:
test "Example Test" {
std.debug.print("{d}", .{1});
}
test "Example Test 2" {
}
Result:
Test [1/2] test.Example Test... 1
Test [2/2] test.Example Test 2...
All 2 tests passed.
With a print:
test "Example Test" {
std.debug.print("{d}", .{1});
}
test "Example Test 2" {
std.debug.print("{d}", .{2});
}
Test [1/2] test.Example Test... 1
Test [2/2] test.Example Test 2... 2
All 2 tests passed.
To be honest, I'm actually really confused how the \n
print only affects the last one, there must be some kind of forward escape somewhere, but I don't know where that might be.
Zig Version
0.10.1
Steps to Reproduce and Observed Behavior
Running a debug print in a
test
such as this:When running the
zig test
on the file containing it, or in any way triggering the test, this will be the output:Clearly, you can see the issue. when running the same test but some any other text around the
{d}
, for example:It will work as expected
test.Example Test... 1
Expected Behavior
I assume, that the excepted behavior should be something like
test.Example Test... 1 All 1 tests passed.
maybe? I don't know exactly how I would handle the lack of an enter in atest
, but there must be something better than this.