diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-25 13:10:58 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-25 13:10:58 +0200 |
| commit | 22ce4f7a80fb6692da3a675e3a652b8f305d157a (patch) | |
| tree | 5e090186c582942c97144392372f470fe4beec4b /src/dom | |
| parent | 15b59f86316f823128be2c66044ee188f9f51394 (diff) | |
perf(tests): use testing allocator instead of debug allocator
Diffstat (limited to 'src/dom')
| -rw-r--r-- | src/dom/Element.zig | 8 | ||||
| -rw-r--r-- | src/dom/html.zig | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/dom/Element.zig b/src/dom/Element.zig index 6a9ac6e..ff1a0f2 100644 --- a/src/dom/Element.zig +++ b/src/dom/Element.zig @@ -206,9 +206,7 @@ fn doTest(alloc: Allocator, el: *Self, exp: []const u8) !void { } test "void element" { - var arena = std.heap.DebugAllocator(.{}).init; - defer if (arena.deinit() == .leak) std.debug.print("leaking!\n", .{}); - const alloc = arena.allocator(); + const alloc = std.testing.allocator; var br = try init(alloc, .void, "br"); defer br.deinit(); @@ -228,9 +226,7 @@ test "void element" { } test "content element" { - var arena = std.heap.DebugAllocator(.{}).init; - defer if (arena.deinit() == .leak) std.debug.print("leaking!\n", .{}); - const alloc = arena.allocator(); + const alloc = std.testing.allocator; var p = try init(alloc, .content, "p"); defer p.deinit(); diff --git a/src/dom/html.zig b/src/dom/html.zig index a3178f2..1734c60 100644 --- a/src/dom/html.zig +++ b/src/dom/html.zig @@ -34,9 +34,7 @@ fn doTest(alloc: std.mem.Allocator, el: []const u8, exp: []const u8) !void { } test "escaping html" { - var arena = std.heap.DebugAllocator(.{}).init; - defer if (arena.deinit() == .leak) std.debug.print("leaking!\n", .{}); - const alloc = arena.allocator(); + const alloc = std.testing.allocator; try doTest(alloc, "hello world", "hello world"); try doTest(alloc, "hello&world", "hello&world"); |
