zig
zig copied to clipboard
`std.log.err` failing tests is unexpected behavior
Often one wants to write unit tests that code handles error paths correctly. In many such cases, one would also log the error to stderr. If you have tests that call a function that calls std.log.err, your tests fail... Which is somewhat odd if logging that error is exactly what you wanted to happen. Currently to work around this developers need to make their own test_runner.zig to change this behavior.
Here's where the failure happens: https://github.com/ziglang/zig/blob/master/lib/compiler/test_runner.zig#L262
Related https://github.com/ziglang/zig/issues/5738