diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 05:19:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 05:55:49 -0300 |
| commit | c8553032ef84aec74cbb5d07d07f934eecf3d4a9 (patch) | |
| tree | e47d3dd72b83e0b95d53271df9f5932dab389959 /test/kitty.zig | |
| parent | de0447471febe1253b42a32fe9a1d6cdccc9d5b9 (diff) | |
| download | pardes-c8553032ef84aec74cbb5d07d07f934eecf3d4a9.tar.gz pardes-c8553032ef84aec74cbb5d07d07f934eecf3d4a9.zip | |
kinds #9, the core's image code gone: src/image.zig (558 lines) and the static table go, so no kind is compiled in (Registry.init, Kind.image, compiledIn, `static` in /addons and "is compiled in" with them) and a test of the core's side of a kind's pane opens Kind.test_kind (a picture of one pixel, no library); a placement's fit (NativeGeometry, containGeometry) moves to surface.zig and a PDF's fit modes to pdf_view.zig; a terminal's kitty PNG decodes in TerminalImages.zig through wuffs as before, its downscale through stb_image_resize, the one part of zstbi the core keeps (stb_image patched out of it, the wuffs_images option, tag_image and image_exts gone); the image cases load the built image.so by path: test/panes.zig's and fs_namespace's through Addon.perform, T1 through Addon load (a new behaviour case: PNG, JPEG and PPM through 9P, the art words, a refused corrupt PNG, a dump's placeholder and its picture back, which replaces the decode unit test and ctl.zig's corrupt-image case), the snapshot, process and image harnesses by linking it into each session's data directory; images.snap unchanged
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/kitty.zig')
| -rw-r--r-- | test/kitty.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/kitty.zig b/test/kitty.zig index 70e20139..ad70f453 100644 --- a/test/kitty.zig +++ b/test/kitty.zig @@ -64,9 +64,9 @@ const Rig = struct { read: [pardes.MAX_PANES]std.ArrayList(u8) = @splat(.empty), fn init(shells: u8) !Rig { - // f=100 decodes through pardes's own decoder (stb_image), which the - // shells start at launch. - pardes.image.start(std.testing.io, gpa); + // f=100 decodes through wuffs, its resize through stb_image_resize, + // which the shells start at launch. + pardes.TerminalImages.start(std.testing.io, gpa); // ghostty warns of every refused command; the refusals are the point. std.testing.log_level = .err; // A core boots one shell or the classic three. @@ -86,7 +86,7 @@ const Rig = struct { for (&r.read) |*b| b.deinit(gpa); r.frame.deinit(); r.p.deinit(); - pardes.image.stop(); + pardes.TerminalImages.stop(); } fn drain(r: *Rig) void { @@ -398,7 +398,7 @@ test "kitty: a=p places one image twice by placement id, a source rect crops it, const crop = cropped orelse return error.CroppedPlacementMissing; try std.testing.expectEqual(o.x + 9, crop.dst.x); try std.testing.expectEqual(@as(u16, 1), crop.dst.w); - const g: pardes.image.NativeGeometry = .{ .src = crop.src, .dst = crop.at.? }; + const g: pardes.NativeGeometry = .{ .src = crop.src, .dst = crop.at.? }; try std.testing.expectEqual(@as(u32, 2), g.src.x); try std.testing.expectEqual(@as(u32, 2), g.src.w); // Put again under the same id, placement 1 moves; it is not doubled. @@ -1212,7 +1212,7 @@ test "kitty: an image wider than its pane is cut at the pane's edge, never drawn try std.testing.expect(drawn[0].dst.x + drawn[0].dst.w <= o.x + r.pane(0).cols); try std.testing.expect(drawn[0].dst.x + drawn[0].dst.w <= right); // And the pixels it takes are only that cell's. - const g: pardes.image.NativeGeometry = .{ .src = drawn[0].src, .dst = drawn[0].at.? }; + const g: pardes.NativeGeometry = .{ .src = drawn[0].src, .dst = drawn[0].at.? }; try std.testing.expect(g.dst.w <= @as(u32, drawn[0].dst.w) * 10); } |
