authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-09 16:21:16-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-09 16:21:16-05:00
loge6c01e49d8a5104a5b71f4524ac7689ed9be9002
treec51b2b85d4aee8eddf70e260dff6eb9615686321
parenta3f6a58c7785e7958f9d0b96d54356944bf34e32
signature Commit is signed but in an unrecognized format.

remove no-longer-needed workaround for var args

See #557

1 files changed, 1 insertions(+), 9 deletions(-)

lib/std/testing.zig+1-9
...@@ -6,15 +6,7 @@ const std = @import("std.zig");...@@ -6,15 +6,7 @@ const std = @import("std.zig");
6/// and then aborts when actual_error_union is not expected_error.6/// and then aborts when actual_error_union is not expected_error.
7pub fn expectError(expected_error: anyerror, actual_error_union: var) void {7pub fn expectError(expected_error: anyerror, actual_error_union: var) void {
8 if (actual_error_union) |actual_payload| {8 if (actual_error_union) |actual_payload| {
9 // TODO remove workaround here for https://github.com/ziglang/zig/issues/5579 std.debug.panic("expected error.{}, found {}", .{ @errorName(expected_error), actual_payload });
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 }
18 } else |actual_error| {10 } else |actual_error| {
19 if (expected_error != actual_error) {11 if (expected_error != actual_error) {
20 std.debug.panic("expected error.{}, found error.{}", .{12 std.debug.panic("expected error.{}, found error.{}", .{