diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/tests.zig | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/tests.zig b/test/tests.zig index 5f64f8e..42c3653 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -161,7 +161,8 @@ const CheckNamedStep = struct { ); defer stderr_file.close(); - const stderr = stderr_file.reader(); + var buffer: [4096]u8 = undefined; + const stderr = stderr_file.reader(&buffer); { // Skip the logo. const nlines = mem.count(u8, root.logo, "\n"); @@ -213,7 +214,8 @@ const CheckStep = struct { ); defer stderr_file.close(); - const stderr = stderr_file.reader(); + var buffer: [4096]u8 = undefined; + const stderr = stderr_file.reader(&buffer); for (exercises) |ex| { if (ex.number() == 1) { // Skip the logo. @@ -298,7 +300,7 @@ fn check( } fn readLine(reader: fs.File.Reader, buf: []u8) !?[]const u8 { - if (try reader.readUntilDelimiterOrEof(buf, '\n')) |line| { + if (try reader.file.deprecatedReader().readUntilDelimiterOrEof(buf, '\n')) |line| { return mem.trimRight(u8, line, " \r\n"); } @@ -405,7 +407,8 @@ fn heal(allocator: Allocator, exercises: []const Exercise, work_path: []const u8 /// difference that returns an error when the temp path cannot be created. pub fn makeTempPath(b: *Build) ![]const u8 { const rand_int = std.crypto.random.int(u64); - const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ Build.hex64(rand_int); + const rand_hex64 = std.fmt.hex(rand_int); + const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ rand_hex64; const path = b.cache_root.join(b.allocator, &.{tmp_dir_sub_path}) catch @panic("OOM"); try b.cache_root.handle.makePath(tmp_dir_sub_path); |
