mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
added expectEqualDeep test coverage for issue 16625 (#22781)
This commit is contained in:
parent
13ad984b1f
commit
5ab5113077
1 changed files with 13 additions and 0 deletions
|
|
@ -932,6 +932,19 @@ test "expectEqualDeep composite type" {
|
|||
try expectEqualDeep(a, b);
|
||||
try expectEqualDeep(&a, &b);
|
||||
}
|
||||
|
||||
// inferred union
|
||||
const TestStruct2 = struct {
|
||||
const A = union(enum) { b: B, c: C };
|
||||
const B = struct {};
|
||||
const C = struct { a: *const A };
|
||||
};
|
||||
|
||||
const union1 = TestStruct2.A{ .b = .{} };
|
||||
try expectEqualDeep(
|
||||
TestStruct2.A{ .c = .{ .a = &union1 } },
|
||||
TestStruct2.A{ .c = .{ .a = &union1 } },
|
||||
);
|
||||
}
|
||||
|
||||
fn printIndicatorLine(source: []const u8, indicator_index: usize) void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue