From 9b2cba2c75b31e504c4eb4f4b4d9d9387c70dae0 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 26 Apr 2026 16:51:26 -0700 Subject: [PATCH] fix test format and toString replaced with nprint in 20cd84586cb6f62f15411d47e7e17ef65ef336a3 --- test.zig | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/test.zig b/test.zig index 35aa58f8455d6c1f36239fc238049e6ee060640b..b10cad68cd0d2139237833223dc32fdf0bde3d81 100644 --- a/test.zig +++ b/test.zig @@ -747,9 +747,7 @@ test { const S = struct { name: []const u8, - pub fn format(s: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { - _ = fmt; - _ = options; + pub fn nprint(s: @This(), writer: anytype) !void { try writer.writeAll(s.name); try writer.writeAll(".com"); } @@ -776,38 +774,6 @@ test { \\ ); } -test { - const S = struct { - name: []const u8, - - pub fn toString(s: @This(), alloc: std.mem.Allocator) ![]const u8 { - return std.fmt.allocPrint(alloc, "{s}.com", .{s.name}); - } - }; - var arena = std.heap.ArenaAllocator.init(std.testing.allocator); - defer arena.deinit(); - const alloc = arena.allocator(); - var builder = std.ArrayList(u8).init(alloc); - defer builder.deinit(); - const doc = comptime pek.parse( - \\body( - \\ p("This host for this link is "a[href=("https://"{host}"/nektro/zig-pek")]("dynamic")".") - \\) - ); - try pek.compileInner( - alloc, - builder.writer(), - doc, - .{ .Ctx = @This(), .indent = 0, .doindent = true, .doindent2 = true }, - .{ .host = S{ .name = "github" } }, - ); - try expect(builder.items).toEqualString( - \\ - \\

This host for this link is dynamic.

- \\ - \\ - ); -} // raw replacement test { -- 2.54.0