mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
std.testing: use debug Io instance in expectEqualSlices
This commit is contained in:
parent
28639bd6d7
commit
eb0d5b1377
1 changed files with 5 additions and 5 deletions
|
|
@ -368,11 +368,11 @@ pub fn expectEqualSlices(comptime T: type, expected: []const T, actual: []const
|
|||
break :diff_index if (expected.len == actual.len) return else shortest;
|
||||
};
|
||||
if (!backend_can_print) return error.TestExpectedEqual;
|
||||
if (io.lockStderr(&.{}, null)) |stderr| {
|
||||
defer io.unlockStderr();
|
||||
const w = &stderr.file_writer.interface;
|
||||
failEqualSlices(T, expected, actual, diff_index, w, stderr.terminal_mode) catch {};
|
||||
} else |_| {}
|
||||
// Intentionally using the debug Io instance rather than the testing Io instance.
|
||||
const stderr = std.debug.lockStderr(&.{});
|
||||
defer std.debug.unlockStderr();
|
||||
const w = &stderr.file_writer.interface;
|
||||
failEqualSlices(T, expected, actual, diff_index, w, stderr.terminal_mode) catch {};
|
||||
return error.TestExpectedEqual;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue