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 {
20532053 // output errors to string
20542054 var errors = try fetch.error_bundle.toOwnedBundle("");
20552055 defer errors.deinit(gpa);
2056 var out = std.ArrayList(u8).init(gpa);
2057 defer out.deinit();
2058 try errors.renderToWriter(.{ .ttyconf = .no_color }, out.writer());
2056 var aw: std.io.Writer.Allocating = .init(gpa);
2057 defer aw.deinit();
2058 try errors.renderToWriter(.{ .ttyconf = .no_color }, &aw.writer);
20592059 try std.testing.expectEqualStrings(
20602060 \\error: unable to unpack
20612061 \\ note: unable to create symlink from 'dir2/file2' to 'filename': SymlinkError
20622062 \\ note: file 'dir2/file4' has unsupported type 'x'
20632063 \\
2064 , out.items);
2064 , aw.getWritten());
20652065 }
20662066};
20672067
......@@ -2428,10 +2428,10 @@ const TestFetchBuilder = struct {
24282428 if (notes_len > 0) {
24292429 try std.testing.expectEqual(notes_len, em.notes_len);
24302430 }
2431 var al = std.ArrayList(u8).init(std.testing.allocator);
2432 defer al.deinit();
2433 try errors.renderToWriter(.{ .ttyconf = .no_color }, al.writer());
2434 try std.testing.expectEqualStrings(msg, al.items);
2431 var aw: std.io.Writer.Allocating = .init(std.testing.allocator);
2432 defer aw.deinit();
2433 try errors.renderToWriter(.{ .ttyconf = .no_color }, &aw.writer);
2434 try std.testing.expectEqualStrings(msg, aw.getWritten());
24352435 }
24362436};
24372437