Skip to content

Commit

Permalink
Add behavior test for empty tuple type
Browse files Browse the repository at this point in the history
Closes #16412
  • Loading branch information
ianprime0509 authored and Vexu committed Oct 3, 2023
1 parent df4853a commit 6734d21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/behavior/tuple.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 6734d21

Please sign in to comment.