authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-11 11:41:17-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-11 13:12:21-05:00
log725b6ee634f01355da4a6badc5675751b85f0bf0
tree067a47b382ed999f34586d3391aa67029c0f46b7
parentb4ad3e71af77b2be4467d67b64c721adfe86ac17
signaturelock-open Commit is signed but in an unrecognized format.

add behavior test case for anonymous list literal syntax


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

test/stage1/behavior/array.zig+14
...@@ -298,3 +298,17 @@ test "implicit cast zero sized array ptr to slice" {...@@ -298,3 +298,17 @@ test "implicit cast zero sized array ptr to slice" {
298 const c: []const u8 = &b;298 const c: []const u8 = &b;
299 expect(c.len == 0);299 expect(c.len == 0);
300}300}
301
302test "anonymous list literal syntax" {
303 const S = struct {
304 fn doTheTest() void {
305 var array: [4]u8 = .{1, 2, 3, 4};
306 expect(array[0] == 1);
307 expect(array[1] == 2);
308 expect(array[2] == 3);
309 expect(array[3] == 4);
310 }
311 };
312 S.doTheTest();
313 comptime S.doTheTest();
314}