aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-18 04:34:26 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-18 04:34:26 -0700
commitf0a43cfda9bcfcbefb24cac3ef01c5c745022c58 (patch)
tree6e1ad0d4b16713078f40bf235aebbef09f8b196d /test/run_tests.cpp
parent826c7f06a3cebdf15d88e5228e705974b215bcd4 (diff)
downloadzig-f0a43cfda9bcfcbefb24cac3ef01c5c745022c58.tar.gz
zig-f0a43cfda9bcfcbefb24cac3ef01c5c745022c58.zip
fix nested arrays
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index edb9afa0ba..f416beb311 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1121,6 +1121,21 @@ pub fn main(args: [][]u8) i32 => {
return 0;
}
)SOURCE", "OK\n");
+
+ add_simple_case("nested arrays", R"SOURCE(
+import "std.zig";
+
+pub fn main(args: [][]u8) i32 => {
+ const array_of_strings = [][]u8 {"hello", "this", "is", "my", "thing"};
+ var i: @typeof(array_of_strings.len) = 0;
+ while (i < array_of_strings.len) {
+ print_str(array_of_strings[i]);
+ print_str("\n");
+ i += 1;
+ }
+ return 0;
+}
+ )SOURCE", "hello\nthis\nis\nmy\nthing\n");
}