summaryrefslogtreecommitdiff
path: root/test/deck
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 14:35:15 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commitbc3d18d27f9fc1155db7fac3946c4d38774f9e65 (patch)
tree9178ce95952797f8a78b16c2b805e53368efb35a /test/deck
parent1ecb9b720840ea8e4753823fa8cddcf5d6a3a4d2 (diff)
downloadpardes-bc3d18d27f9fc1155db7fac3946c4d38774f9e65.tar.gz
pardes-bc3d18d27f9fc1155db7fac3946c4d38774f9e65.zip
Build with Zig 0.17
ghostty, libvaxis and uucode move to ghostty's 0.17 pins, cloud9 to its 0.17 main, SDL to castholm's release-3.4.x (3.4.18), zstbi and tree-sitter to forks with 0.17 build files (see build.zig.zon). A bare zig build copies the binaries into ~/.local/bin (-Dhome-install=false leaves it out): 0.17 keeps the prefix from build scripts. A terminal's edited copy goes when the program clears the screen. tinywin.snap is gone; perf baselines are re-recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/deck')
-rw-r--r--test/deck/replay.zig5
-rw-r--r--test/deck/schema.zig10
2 files changed, 7 insertions, 8 deletions
diff --git a/test/deck/replay.zig b/test/deck/replay.zig
index 475f7476..49614b46 100644
--- a/test/deck/replay.zig
+++ b/test/deck/replay.zig
@@ -20,8 +20,9 @@ const Tally = struct {
fn replay(src: [:0]const u8) !Tally {
const gpa = std.testing.allocator;
- const rec = try schema.parse(gpa, src);
- defer schema.free(gpa, rec);
+ var arena: std.heap.ArenaAllocator = .init(gpa);
+ defer arena.deinit();
+ const rec = try schema.parse(gpa, arena.allocator(), src);
var d: deck.Deck = .{};
var tally: Tally = .{};
for (rec.events) |ev| {
diff --git a/test/deck/schema.zig b/test/deck/schema.zig
index 782c829a..401e15e8 100644
--- a/test/deck/schema.zig
+++ b/test/deck/schema.zig
@@ -61,10 +61,8 @@ pub const Event = struct {
};
};
-pub fn parse(gpa: std.mem.Allocator, src: [:0]const u8) error{ OutOfMemory, ParseZon }!Recording {
- return std.zon.parse.fromSliceAlloc(Recording, gpa, src, null, .{});
-}
-
-pub fn free(gpa: std.mem.Allocator, rec: Recording) void {
- std.zon.parse.free(gpa, rec);
+/// The recording's slices live in `arena`.
+pub fn parse(gpa: std.mem.Allocator, arena: std.mem.Allocator, src: [:0]const u8) error{ OutOfMemory, ParseZon }!Recording {
+ var diagnostics: std.zon.parse.Diagnostics = undefined;
+ return std.zon.parse.fromSlice(Recording, .{ .gpa = gpa, .arena = arena, .source = src, .diagnostics = &diagnostics });
}