zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 9fa9c7abd097a8a09e11e049ffcd7d0bbb439683 (tree)
parent 862266514ae184eb743959bd0a67db0628b5247a
Author: gooncreeper <goon.pri.low@gmail.com>
Date:   Fri,  8 Nov 2024 22:03:34 -0500

std.testing.expectError: fix error names

Diffstat:
Mlib/std/testing.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/std/testing.zig b/lib/std/testing.zig @@ -41,14 +41,14 @@ fn print(comptime fmt: []const u8, args: anytype) void { pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void { if (actual_error_union) |actual_payload| { print("expected error.{s}, found {any}\n", .{ @errorName(expected_error), actual_payload }); - return error.TestUnexpectedError; + return error.TestExpectedError; } else |actual_error| { if (expected_error != actual_error) { print("expected error.{s}, found error.{s}\n", .{ @errorName(expected_error), @errorName(actual_error), }); - return error.TestExpectedError; + return error.TestUnexpectedError; } } }