| ... | @@ -41,14 +41,14 @@ fn print(comptime fmt: []const u8, args: anytype) void { | ... | @@ -41,14 +41,14 @@ fn print(comptime fmt: []const u8, args: anytype) void { |
| 41 | pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void { | 41 | pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void { |
| 42 | if (actual_error_union) |actual_payload| { | 42 | if (actual_error_union) |actual_payload| { |
| 43 | print("expected error.{s}, found {any}\n", .{ @errorName(expected_error), actual_payload }); | 43 | print("expected error.{s}, found {any}\n", .{ @errorName(expected_error), actual_payload }); |
| 44 | return error.TestUnexpectedError; | 44 | return error.TestExpectedError; |
| 45 | } else |actual_error| { | 45 | } else |actual_error| { |
| 46 | if (expected_error != actual_error) { | 46 | if (expected_error != actual_error) { |
| 47 | print("expected error.{s}, found error.{s}\n", .{ | 47 | print("expected error.{s}, found error.{s}\n", .{ |
| 48 | @errorName(expected_error), | 48 | @errorName(expected_error), |
| 49 | @errorName(actual_error), | 49 | @errorName(actual_error), |
| 50 | }); | 50 | }); |
| 51 | return error.TestExpectedError; | 51 | return error.TestUnexpectedError; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | } | 54 | } |