| ... | ... | @@ -6,15 +6,7 @@ const std = @import("std.zig"); |
| 6 | 6 | /// and then aborts when actual_error_union is not expected_error. |
| 7 | 7 | pub fn expectError(expected_error: anyerror, actual_error_union: var) void { |
| 8 | 8 | if (actual_error_union) |actual_payload| { |
| 9 | | // TODO remove workaround here for https://github.com/ziglang/zig/issues/557 |
| 10 | | if (@sizeOf(@typeOf(actual_payload)) == 0) { |
| 11 | | std.debug.panic("expected error.{}, found {} value", .{ |
| 12 | | @errorName(expected_error), |
| 13 | | @typeName(@typeOf(actual_payload)), |
| 14 | | }); |
| 15 | | } else { |
| 16 | | std.debug.panic("expected error.{}, found {}", .{ @errorName(expected_error), actual_payload }); |
| 17 | | } |
| 9 | std.debug.panic("expected error.{}, found {}", .{ @errorName(expected_error), actual_payload }); |
| 18 | 10 | } else |actual_error| { |
| 19 | 11 | if (expected_error != actual_error) { |
| 20 | 12 | std.debug.panic("expected error.{}, found error.{}", .{ |