diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-18 21:13:14 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-18 21:13:14 -0700 |
| commit | ae2151a751f62bd47b0eac37467c2de9f23101a3 (patch) | |
| tree | 3dd22c22a6e6ed9eeed46595925b2e46d4261097 /test/run_tests.cpp | |
| parent | 92dccde2fd7a26ed6b18af4fc4f2dc6b18766a5f (diff) | |
| download | zig-ae2151a751f62bd47b0eac37467c2de9f23101a3.tar.gz zig-ae2151a751f62bd47b0eac37467c2de9f23101a3.zip | |
use signed integer for sizes of things
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 9c7db17792..91cfd66317 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -394,16 +394,16 @@ done: import "std.zig"; pub fn main(args: [][]u8) i32 => { - var array : [5]u32; + var array : [5]i32; - var i : u32 = 0; + var i : i32 = 0; while (i < 5) { array[i] = i + 1; i = array[i]; } i = 0; - var accumulator = u32(0); + var accumulator = i32(0); while (i < 5) { accumulator += array[i]; @@ -420,7 +420,7 @@ pub fn main(args: [][]u8) i32 => { return 0; } -fn get_array_len(a: []u32) usize => { +fn get_array_len(a: []i32) isize => { a.len } )SOURCE", "OK\n"); @@ -856,7 +856,7 @@ pub fn main(args: [][]u8) i32 => { add_simple_case("constant expressions", R"SOURCE( import "std.zig"; -const ARRAY_SIZE : u8 = 20; +const ARRAY_SIZE : i8 = 20; pub fn main(args: [][]u8) i32 => { var array : [ARRAY_SIZE]u8; @@ -1147,7 +1147,7 @@ pub fn main(args: [][]u8) i32 => { print_str("\n"); } for (item, array, index) { - print_u64(index); + print_i64(index); print_str("\n"); } const unknown_size: []u8 = array; @@ -1156,7 +1156,7 @@ pub fn main(args: [][]u8) i32 => { print_str("\n"); } for (item, unknown_size, index) { - print_u64(index); + print_i64(index); print_str("\n"); } return 0; @@ -1356,9 +1356,9 @@ fn f() => { ".tmp_source.zig:4:12: error: use of undeclared identifier 'i'", ".tmp_source.zig:4:14: error: use of undeclared identifier 'i'", ".tmp_source.zig:5:8: error: array access of non-array", - ".tmp_source.zig:5:9: error: expected type 'usize', got 'bool'", + ".tmp_source.zig:5:9: error: expected type 'isize', got 'bool'", ".tmp_source.zig:5:19: error: array access of non-array", - ".tmp_source.zig:5:20: error: expected type 'usize', got 'bool'"); + ".tmp_source.zig:5:20: error: expected type 'isize', got 'bool'"); add_compile_fail_case("variadic functions only allowed in extern", R"SOURCE( fn f(...) => {} |
