authorgravatar for bgt37@cornell.eduBenjamin Thompson <bgt37@cornell.edu> 2025-02-15 12:41:58+10:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-02-15 03:41:58+01:00
log5ab5113077bf82237978168b32e2b549a4a71feb
treed86af729402d6ac5fff58c907067c5e0054a0260
parent13ad984b1f403c240ee677c32c2b43980d098be3
signaturebadge-check Signed by PGP key B5690EEEBB952194

added expectEqualDeep test coverage for issue 16625 (#22781)


1 files changed, 13 insertions(+), 0 deletions(-)

lib/std/testing.zig+13
...@@ -932,6 +932,19 @@ test "expectEqualDeep composite type" {...@@ -932,6 +932,19 @@ test "expectEqualDeep composite type" {
932 try expectEqualDeep(a, b);932 try expectEqualDeep(a, b);
933 try expectEqualDeep(&a, &b);933 try expectEqualDeep(&a, &b);
934 }934 }
935
936 // inferred union
937 const TestStruct2 = struct {
938 const A = union(enum) { b: B, c: C };
939 const B = struct {};
940 const C = struct { a: *const A };
941 };
942
943 const union1 = TestStruct2.A{ .b = .{} };
944 try expectEqualDeep(
945 TestStruct2.A{ .c = .{ .a = &union1 } },
946 TestStruct2.A{ .c = .{ .a = &union1 } },
947 );
935}948}
936949
937fn printIndicatorLine(source: []const u8, indicator_index: usize) void {950fn printIndicatorLine(source: []const u8, indicator_index: usize) void {