authorgravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2019-02-10 12:43:49+01:00
committergravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2019-02-10 12:43:49+01:00
log2f9fedabf0805a47aba5c348e5369c1c28f6cf21
tree49cc818d0aa4b48428674967a03b7d58353882fb
parentcaf672c49586f1af5e3d41ae200aded991b8b0f7

testing.expectEqual use expected type as the type of actual

This allows for impl casts

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

std/testing.zig+1-5
......@@ -24,11 +24,7 @@ pub fn expectError(expected_error: anyerror, actual_error_union: var) void {
2424/// equal, prints diagnostics to stderr to show exactly how they are not equal,
2525/// then aborts.
2626/// The types must match exactly.
27pub fn expectEqual(expected: var, actual: var) void {
28 if (@typeOf(actual) != @typeOf(expected)) {
29 @compileError("type mismatch. expected " ++ @typeName(@typeOf(expected)) ++ ", found " ++ @typeName(@typeOf(actual)));
30 }
31
27pub fn expectEqual(expected: var, actual: @typeOf(expected)) void {
3228 switch (@typeInfo(@typeOf(actual))) {
3329 TypeId.NoReturn,
3430 TypeId.BoundFn,