diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-09 18:57:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-09 18:57:39 -0500 |
| commit | 1864acd32608ae917f8afc11b11f08a4bb362cef (patch) | |
| tree | d96b50a927fc67583d88c71822513594609621fb /test/cli.zig | |
| parent | 48c1e235cb620dacc30254d0898390b4d97f3e73 (diff) | |
| parent | ca8580ece1ab07215b72394cc4ab3030bf9df139 (diff) | |
| download | zig-1864acd32608ae917f8afc11b11f08a4bb362cef.tar.gz zig-1864acd32608ae917f8afc11b11f08a4bb362cef.zip | |
Merge remote-tracking branch 'origin/master' into llvm8
Diffstat (limited to 'test/cli.zig')
| -rw-r--r-- | test/cli.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/cli.zig b/test/cli.zig index 6ad97415fa..d7490dcc76 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -1,7 +1,7 @@ const std = @import("std"); const builtin = @import("builtin"); const os = std.os; -const assertOrPanic = std.debug.assertOrPanic; +const testing = std.testing; var a: *std.mem.Allocator = undefined; @@ -87,13 +87,13 @@ fn exec(cwd: []const u8, argv: []const []const u8) !os.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" }); - assertOrPanic(std.mem.endsWith(u8, test_result.stderr, "All tests passed.\n")); + 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" }); - assertOrPanic(std.mem.eql(u8, run_result.stderr, "All your base are belong to us.\n")); + 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 { @@ -126,7 +126,7 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void { _ = try exec(dir_path, args); const out_asm = try std.io.readFileAlloc(a, example_s_path); - assertOrPanic(std.mem.indexOf(u8, out_asm, "square:") != null); - assertOrPanic(std.mem.indexOf(u8, out_asm, "mov\teax, edi") != null); - assertOrPanic(std.mem.indexOf(u8, out_asm, "imul\teax, edi") != null); + testing.expect(std.mem.indexOf(u8, out_asm, "square:") != null); + testing.expect(std.mem.indexOf(u8, out_asm, "mov\teax, edi") != null); + testing.expect(std.mem.indexOf(u8, out_asm, "imul\teax, edi") != null); } |
