authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-07 20:30:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-07 22:43:53-07:00
log26659c862f323697e0b239726941cd39d96c74ff
tree88cc0fa8101db747641cc8620364f166eea7916a
parentb0395531d37db8ebde3d4cc09accef2f3b49457d

update compiler unit tests to new API


1 files changed, 8 insertions(+), 8 deletions(-)

src/Package/Fetch.zig+8-8
...@@ -2053,15 +2053,15 @@ const UnpackResult = struct {...@@ -2053,15 +2053,15 @@ const UnpackResult = struct {
2053 // output errors to string2053 // output errors to string
2054 var errors = try fetch.error_bundle.toOwnedBundle("");2054 var errors = try fetch.error_bundle.toOwnedBundle("");
2055 defer errors.deinit(gpa);2055 defer errors.deinit(gpa);
2056 var out = std.ArrayList(u8).init(gpa);2056 var aw: std.io.Writer.Allocating = .init(gpa);
2057 defer out.deinit();2057 defer aw.deinit();
2058 try errors.renderToWriter(.{ .ttyconf = .no_color }, out.writer());2058 try errors.renderToWriter(.{ .ttyconf = .no_color }, &aw.writer);
2059 try std.testing.expectEqualStrings(2059 try std.testing.expectEqualStrings(
2060 \\error: unable to unpack2060 \\error: unable to unpack
2061 \\ note: unable to create symlink from 'dir2/file2' to 'filename': SymlinkError2061 \\ note: unable to create symlink from 'dir2/file2' to 'filename': SymlinkError
2062 \\ note: file 'dir2/file4' has unsupported type 'x'2062 \\ note: file 'dir2/file4' has unsupported type 'x'
2063 \\2063 \\
2064 , out.items);2064 , aw.getWritten());
2065 }2065 }
2066};2066};
20672067
...@@ -2428,10 +2428,10 @@ const TestFetchBuilder = struct {...@@ -2428,10 +2428,10 @@ const TestFetchBuilder = struct {
2428 if (notes_len > 0) {2428 if (notes_len > 0) {
2429 try std.testing.expectEqual(notes_len, em.notes_len);2429 try std.testing.expectEqual(notes_len, em.notes_len);
2430 }2430 }
2431 var al = std.ArrayList(u8).init(std.testing.allocator);2431 var aw: std.io.Writer.Allocating = .init(std.testing.allocator);
2432 defer al.deinit();2432 defer aw.deinit();
2433 try errors.renderToWriter(.{ .ttyconf = .no_color }, al.writer());2433 try errors.renderToWriter(.{ .ttyconf = .no_color }, &aw.writer);
2434 try std.testing.expectEqualStrings(msg, al.items);2434 try std.testing.expectEqualStrings(msg, aw.getWritten());
2435 }2435 }
2436};2436};
24372437