This commit is contained in:
Karl Seguin
2025-02-01 15:38:08 +08:00
parent fc0ec860b0
commit 3d66758507
2 changed files with 12 additions and 27 deletions

View File

@@ -173,7 +173,7 @@ test "generate.Union" {
value: u8 = 0,
};
const value = Union(.{ Astruct, Bstruct, .{ Cstruct } });
const value = Union(.{ Astruct, Bstruct, .{Cstruct} });
const ti = @typeInfo(value).Union;
try std.testing.expectEqual(3, ti.fields.len);
try std.testing.expectEqualStrings("*generate.test.generate.Union.Astruct.Other", @typeName(ti.fields[0].type));
@@ -185,8 +185,7 @@ test "generate.Union" {
}
test "generate.Tuple" {
const Astruct = struct {
};
const Astruct = struct {};
const Bstruct = struct {
value: u8 = 0,
@@ -207,7 +206,7 @@ test "generate.Tuple" {
{
// dedupe
const tuple = Tuple(.{ Cstruct, Astruct, .{ Astruct }, Bstruct, .{ Astruct, .{ Astruct, Bstruct } } }){};
const tuple = Tuple(.{ Cstruct, Astruct, .{Astruct}, Bstruct, .{ Astruct, .{ Astruct, Bstruct } } }){};
const ti = @typeInfo(@TypeOf(tuple)).Struct;
try std.testing.expectEqual(true, ti.is_tuple);
try std.testing.expectEqual(3, ti.fields.len);