fix nested arrays

This commit is contained in:
Andrew Kelley
2016-01-18 04:34:26 -07:00
parent 826c7f06a3
commit f0a43cfda9
3 changed files with 87 additions and 29 deletions

View File

@@ -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");
}