diff options
| author | Ian Johnson <ian@ianjohnson.dev> | 2023-10-02 23:29:29 -0400 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2023-10-03 16:01:08 +0300 |
| commit | 6734d2117e3520c1ef011609d0e2b2dd131a80aa (patch) | |
| tree | b2eaef46962a80ea8ebe4f17c0850bbb166b15b7 /test/behavior/tuple.zig | |
| parent | df4853a6271b7963d77cafda7d6727274c6cbdaa (diff) | |
| download | zig-6734d2117e3520c1ef011609d0e2b2dd131a80aa.tar.gz zig-6734d2117e3520c1ef011609d0e2b2dd131a80aa.zip | |
Add behavior test for empty tuple type
Closes #16412
Diffstat (limited to 'test/behavior/tuple.zig')
| -rw-r--r-- | test/behavior/tuple.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/behavior/tuple.zig b/test/behavior/tuple.zig index 57c1c920e7..48c24f26d6 100644 --- a/test/behavior/tuple.zig +++ b/test/behavior/tuple.zig @@ -465,3 +465,15 @@ test "coerce anon tuple to tuple" { try expectEqual(x, s[0]); try expectEqual(y, s[1]); } + +test "empty tuple type" { + const S = @Type(.{ .Struct = .{ + .layout = .Auto, + .fields = &.{}, + .decls = &.{}, + .is_tuple = true, + } }); + + const s: S = .{}; + try expect(s.len == 0); +} |
