aboutsummaryrefslogtreecommitdiff
path: root/src/dom/html.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-17 18:07:11 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-17 18:07:11 +0200
commit87e5daf9156583072d9ccb9ff0fa074f65fa6836 (patch)
tree016d7bab36eac1a79b0a252ed8647af5b68bb028 /src/dom/html.zig
parent256a992e660869d28f5f2fd69bfe59a8ff591989 (diff)
style(): rename alloc into gpa
Diffstat (limited to 'src/dom/html.zig')
-rw-r--r--src/dom/html.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/dom/html.zig b/src/dom/html.zig
index bf62fbb..4b39a3f 100644
--- a/src/dom/html.zig
+++ b/src/dom/html.zig
@@ -24,9 +24,9 @@ pub fn escape(gpa: std.mem.Allocator, v: []const u8) ![]const u8 {
return acc.toOwnedSlice(gpa);
}
-fn doTest(alloc: std.mem.Allocator, el: []const u8, exp: []const u8) !void {
- const got = try escape(alloc, el);
- defer alloc.free(got);
+fn doTest(gpa: std.mem.Allocator, el: []const u8, exp: []const u8) !void {
+ const got = try escape(gpa, el);
+ defer gpa.free(got);
std.testing.expect(eql(u8, got, exp)) catch |err| {
std.debug.print("{s}\n", .{got});
return err;
@@ -36,12 +36,12 @@ fn doTest(alloc: std.mem.Allocator, el: []const u8, exp: []const u8) !void {
test "escaping html" {
var arena = std.heap.DebugAllocator(.{}).init;
defer _ = arena.deinit();
- const alloc = arena.allocator();
+ const gpa = arena.allocator();
- try doTest(alloc, "hello world", "hello world");
- try doTest(alloc, "hello&world", "hello&amp;world");
- try doTest(alloc, "hello'world", "hello&#39;world");
- try doTest(alloc, "hello<world", "hello&lt;world");
- try doTest(alloc, "hello>world", "hello&gt;world");
- try doTest(alloc, "hello\"world", "hello&#34;world");
+ try doTest(gpa, "hello world", "hello world");
+ try doTest(gpa, "hello&world", "hello&amp;world");
+ try doTest(gpa, "hello'world", "hello&#39;world");
+ try doTest(gpa, "hello<world", "hello&lt;world");
+ try doTest(gpa, "hello>world", "hello&gt;world");
+ try doTest(gpa, "hello\"world", "hello&#34;world");
}