aboutsummaryrefslogtreecommitdiff
path: root/test/cli.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-09 19:24:24 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-09 19:26:32 -0400
commitb735764898412c5b9388fdf729c8ad8db43ddde5 (patch)
tree1a5873e654ff7189b236acc15516b9c6cd35a315 /test/cli.zig
parent10e33b35368735d1911a073bcb7cbbaebee671ee (diff)
downloadzig-b735764898412c5b9388fdf729c8ad8db43ddde5.tar.gz
zig-b735764898412c5b9388fdf729c8ad8db43ddde5.zip
different array literal syntax when inferring the size
old syntax: []i32{1, 2, 3} new syntax: [_]i32{1, 2, 3} closes #1797
Diffstat (limited to 'test/cli.zig')
-rw-r--r--test/cli.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/cli.zig b/test/cli.zig
index cee030e4db..e68bd35167 100644
--- a/test/cli.zig
+++ b/test/cli.zig
@@ -29,11 +29,11 @@ pub fn main() !void {
std.debug.warn("Expected second argument to be cache root directory path\n");
return error.InvalidArgs;
});
- const zig_exe = try fs.path.resolve(a, [][]const u8{zig_exe_rel});
+ const zig_exe = try fs.path.resolve(a, [_][]const u8{zig_exe_rel});
- const dir_path = try fs.path.join(a, [][]const u8{ cache_root, "clitest" });
+ const dir_path = try fs.path.join(a, [_][]const u8{ cache_root, "clitest" });
const TestFn = fn ([]const u8, []const u8) anyerror!void;
- const test_fns = []TestFn{
+ const test_fns = [_]TestFn{
testZigInitLib,
testZigInitExe,
testGodboltApi,
@@ -87,22 +87,22 @@ fn exec(cwd: []const u8, argv: []const []const u8) !ChildProcess.ExecResult {
}
fn testZigInitLib(zig_exe: []const u8, dir_path: []const u8) !void {
- _ = try exec(dir_path, [][]const u8{ zig_exe, "init-lib" });
- const test_result = try exec(dir_path, [][]const u8{ zig_exe, "build", "test" });
+ _ = try exec(dir_path, [_][]const u8{ zig_exe, "init-lib" });
+ const test_result = try exec(dir_path, [_][]const u8{ zig_exe, "build", "test" });
testing.expect(std.mem.endsWith(u8, test_result.stderr, "All tests passed.\n"));
}
fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void {
- _ = try exec(dir_path, [][]const u8{ zig_exe, "init-exe" });
- const run_result = try exec(dir_path, [][]const u8{ zig_exe, "build", "run" });
+ _ = try exec(dir_path, [_][]const u8{ zig_exe, "init-exe" });
+ const run_result = try exec(dir_path, [_][]const u8{ zig_exe, "build", "run" });
testing.expect(std.mem.eql(u8, run_result.stderr, "All your base are belong to us.\n"));
}
fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
if (builtin.os != .linux or builtin.arch != .x86_64) return;
- const example_zig_path = try fs.path.join(a, [][]const u8{ dir_path, "example.zig" });
- const example_s_path = try fs.path.join(a, [][]const u8{ dir_path, "example.s" });
+ const example_zig_path = try fs.path.join(a, [_][]const u8{ dir_path, "example.zig" });
+ const example_s_path = try fs.path.join(a, [_][]const u8{ dir_path, "example.s" });
try std.io.writeFile(example_zig_path,
\\// Type your code here, or load an example.
@@ -115,7 +115,7 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
\\}
);
- const args = [][]const u8{
+ const args = [_][]const u8{
zig_exe, "build-obj",
"--cache-dir", dir_path,
"--name", "example",