authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-15 03:14:03 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-15 03:14:03 -07:00
log3b9df8487b38849f5b36fc8b81fbaf332680464b
treea13aad54c5e84d62ce2301392f01960e9f516a78
parentdf1831b12208f511e1c20d7f8c91a5984f7d15df

expectSimilarType: use self for checking field types


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

src/expectSimilarType.zig+3-3
...@@ -17,7 +17,7 @@ pub fn expectSimilarType(comptime A: type, comptime B: type) !void {...@@ -17,7 +17,7 @@ pub fn expectSimilarType(comptime A: type, comptime B: type) !void {
1717
18 inline for (info_a_s.fields, info_b_s.fields) |fa, fb| {18 inline for (info_a_s.fields, info_b_s.fields) |fa, fb| {
19 try std.testing.expect(std.mem.eql(u8, fa.name, fb.name));19 try std.testing.expect(std.mem.eql(u8, fa.name, fb.name));
20 try std.testing.expect(fa.type == fb.type);20 try expectSimilarType(fa.type, fb.type);
21 try std.testing.expect(fa.alignment == fb.alignment);21 try std.testing.expect(fa.alignment == fb.alignment);
22 try std.testing.expect(fa.is_comptime == fb.is_comptime);22 try std.testing.expect(fa.is_comptime == fb.is_comptime);
23 }23 }
...@@ -33,7 +33,7 @@ pub fn expectSimilarType(comptime A: type, comptime B: type) !void {...@@ -33,7 +33,7 @@ pub fn expectSimilarType(comptime A: type, comptime B: type) !void {
3333
34 inline for (info_a_u.fields, info_b_u.fields) |fa, fb| {34 inline for (info_a_u.fields, info_b_u.fields) |fa, fb| {
35 try std.testing.expect(std.mem.eql(u8, fa.name, fb.name));35 try std.testing.expect(std.mem.eql(u8, fa.name, fb.name));
36 try std.testing.expect(fa.type == fb.type);36 try expectSimilarType(fa.type, fb.type);
37 try std.testing.expect(fa.alignment == fb.alignment);37 try std.testing.expect(fa.alignment == fb.alignment);
38 }38 }
3939
...@@ -53,7 +53,7 @@ pub fn expectSimilarType(comptime A: type, comptime B: type) !void {...@@ -53,7 +53,7 @@ pub fn expectSimilarType(comptime A: type, comptime B: type) !void {
5353
54 return;54 return;
55 }55 }
56 @compileError("not implemented");56 try std.testing.expect(A == B);
57}57}
5858
59test {59test {