diff options
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 0c6669b8c4..d612463449 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1102,6 +1102,25 @@ pub fn main(argc: isize, argv: &&u8, env: &&u8) i32 => { return 0; } )SOURCE", "OK\n"); + + add_simple_case("array literal", R"SOURCE( +import "std.zig"; + +pub fn main(argc: isize, argv: &&u8, env: &&u8) i32 => { + const HEX_MULT = []u16{4096, 256, 16, 1}; + + if (HEX_MULT.len != 4) { + print_str("BAD\n"); + } + + if (HEX_MULT[1] != 256) { + print_str("BAD\n"); + } + + print_str("OK\n"); + return 0; +} + )SOURCE", "OK\n"); } |
