diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-31 16:30:46 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-31 16:30:46 -0400 |
| commit | 67b6dd28ec70937a29176719b56457ee17b1c136 (patch) | |
| tree | cf6e7e1585d8cb1b56ba77ec53562f7502c5e65d /test/cases/array.zig | |
| parent | eb0979189be33d6d957dad5104650cb5c532055b (diff) | |
| download | zig-67b6dd28ec70937a29176719b56457ee17b1c136.tar.gz zig-67b6dd28ec70937a29176719b56457ee17b1c136.zip | |
allow array literals to have size and fix comptime bug
Diffstat (limited to 'test/cases/array.zig')
| -rw-r--r-- | test/cases/array.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/cases/array.zig b/test/cases/array.zig index 7785afecc6..07448ecd22 100644 --- a/test/cases/array.zig +++ b/test/cases/array.zig @@ -80,3 +80,9 @@ test "set global var array via slice embedded in struct" { assert(s_array[1].b == 2); assert(s_array[2].b == 3); } + +test "array literal with specified size" { + var array = [2]u8{1, 2}; + assert(array[0] == 1); + assert(array[1] == 2); +} |
