From f0a43cfda9bcfcbefb24cac3ef01c5c745022c58 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 18 Jan 2016 04:34:26 -0700 Subject: fix nested arrays --- test/run_tests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/run_tests.cpp') 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"); } -- cgit v1.2.3