aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-15 20:01:49 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-15 20:01:49 -0700
commit8205253b2b660791ff074b7cb09b8f11bfe924dc (patch)
tree1b6c2bcd23ea540966c7a804af09108647b163d9 /test/run_tests.cpp
parent8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b (diff)
downloadzig-8205253b2b660791ff074b7cb09b8f11bfe924dc.tar.gz
zig-8205253b2b660791ff074b7cb09b8f11bfe924dc.zip
support array literals
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp19
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");
}