aboutsummaryrefslogtreecommitdiff
path: root/test/cli.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-30 14:23:22 -0400
committerAndrew Kelley <andrew@ziglang.org>2020-03-30 14:23:22 -0400
commit9e7ae062492d4b41564832d37408336e36165e67 (patch)
treeb6b898deb26a63f264ee43e00ecfe883a1e8db99 /test/cli.zig
parentb980568c810fda4c014da42be8e5108b4cbadb7c (diff)
downloadzig-9e7ae062492d4b41564832d37408336e36165e67.tar.gz
zig-9e7ae062492d4b41564832d37408336e36165e67.zip
std lib API deprecations for the upcoming 0.6.0 release
See #3811
Diffstat (limited to 'test/cli.zig')
-rw-r--r--test/cli.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/cli.zig b/test/cli.zig
index 4c067d16ae..3af78e1857 100644
--- a/test/cli.zig
+++ b/test/cli.zig
@@ -59,7 +59,12 @@ fn printCmd(cwd: []const u8, argv: []const []const u8) void {
fn exec(cwd: []const u8, argv: []const []const u8) !ChildProcess.ExecResult {
const max_output_size = 100 * 1024;
- const result = ChildProcess.exec(a, argv, cwd, null, max_output_size) catch |err| {
+ const result = ChildProcess.exec(.{
+ .allocator = a,
+ .argv = argv,
+ .cwd = cwd,
+ .max_output_bytes = max_output_size,
+ }) catch |err| {
std.debug.warn("The following command failed:\n", .{});
printCmd(cwd, argv);
return err;
@@ -101,7 +106,7 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
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,
+ try fs.cwd().writeFile(example_zig_path,
\\// Type your code here, or load an example.
\\export fn square(num: i32) i32 {
\\ return num * num;
@@ -124,7 +129,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);
+ const out_asm = try std.fs.cwd().readFileAlloc(a, example_s_path, std.math.maxInt(usize));
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);