mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
update compiler unit tests to new API
This commit is contained in:
parent
b0395531d3
commit
26659c862f
@ -2053,15 +2053,15 @@ const UnpackResult = struct {
|
||||
// output errors to string
|
||||
var errors = try fetch.error_bundle.toOwnedBundle("");
|
||||
defer errors.deinit(gpa);
|
||||
var out = std.ArrayList(u8).init(gpa);
|
||||
defer out.deinit();
|
||||
try errors.renderToWriter(.{ .ttyconf = .no_color }, out.writer());
|
||||
var aw: std.io.Writer.Allocating = .init(gpa);
|
||||
defer aw.deinit();
|
||||
try errors.renderToWriter(.{ .ttyconf = .no_color }, &aw.writer);
|
||||
try std.testing.expectEqualStrings(
|
||||
\\error: unable to unpack
|
||||
\\ note: unable to create symlink from 'dir2/file2' to 'filename': SymlinkError
|
||||
\\ note: file 'dir2/file4' has unsupported type 'x'
|
||||
\\
|
||||
, out.items);
|
||||
, aw.getWritten());
|
||||
}
|
||||
};
|
||||
|
||||
@ -2428,10 +2428,10 @@ const TestFetchBuilder = struct {
|
||||
if (notes_len > 0) {
|
||||
try std.testing.expectEqual(notes_len, em.notes_len);
|
||||
}
|
||||
var al = std.ArrayList(u8).init(std.testing.allocator);
|
||||
defer al.deinit();
|
||||
try errors.renderToWriter(.{ .ttyconf = .no_color }, al.writer());
|
||||
try std.testing.expectEqualStrings(msg, al.items);
|
||||
var aw: std.io.Writer.Allocating = .init(std.testing.allocator);
|
||||
defer aw.deinit();
|
||||
try errors.renderToWriter(.{ .ttyconf = .no_color }, &aw.writer);
|
||||
try std.testing.expectEqualStrings(msg, aw.getWritten());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user