summaryrefslogtreecommitdiff
path: root/test/snapshot.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-27 01:03:46 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit42c0524b94d67caebbf71cd8a82d7690380195fa (patch)
tree3608f786909c41f3a47d73d1a0b07c26ff1675bc /test/snapshot.zig
parent950a616e45f76349c3f029e6032cce7cadc2b4e3 (diff)
downloadpardes-42c0524b94d67caebbf71cd8a82d7690380195fa.tar.gz
pardes-42c0524b94d67caebbf71cd8a82d7690380195fa.zip
trim the taglines: image renderer toggles and Colors/Crt become leader-only
The image tag spelled out `Petscii <C64|Term> Ascii` and actOnSelection matched those words by hand before the builtin dispatch. They are three real Builtins now (SPC t p/l/a), so the by-word matching is gone, the tag is a plain `img <path> Del`, and with nothing live left in it the image early-returns in curTail, enterTagEdit and the tag-click guard go too — an image tag edits like every other pane's. Colors and Crt leave the topbar for SPC t c / SPC t r: set-once display switches should not spend width in a bar you read every frame. NextColor stays, it is the one you cycle repeatedly. Both remain full builtins. The snap scripts that clicked those words now press the leader instead, and images.snap finally exercises the palette and ascii toggles for real: its old clicks at x=57 landed on the neighbouring shell's tag, so that toggle had never been covered. The test PPM grew to 512x512 with LCG noise so the ASCII bitmaps actually win cells and dropping them visibly changes the art.
Diffstat (limited to 'test/snapshot.zig')
-rw-r--r--test/snapshot.zig21
1 files changed, 16 insertions, 5 deletions
diff --git a/test/snapshot.zig b/test/snapshot.zig
index 5417530d..f1ebd941 100644
--- a/test/snapshot.zig
+++ b/test/snapshot.zig
@@ -168,15 +168,26 @@ fn runScript(arena: std.mem.Allocator, exe_z: [:0]const u8, script_path: []const
for (1..n + 1) |i| try buf.appendSlice(arena, try std.fmt.allocPrint(arena, "line {d}\n", .{i}));
try eh.writeFile(try arena.dupeZ(u8, name), buf.items);
} else if (std.mem.eql(u8, cmd, "ppmdiag")) {
- // the 64x64 diagonal-split test PPM (white/blue) from the old e2e
+ // The diagonal-split test PPM from the old e2e (white over blue),
+ // grown to 512x512 with the white half filled by a fixed LCG
+ // noise. Both halves are load-bearing: the clean edge is what the
+ // block/sextant glyphs match exactly, the noise is fine enough
+ // (one source pixel per matcher subcell at this size) that the
+ // ASCII bitmaps win instead — so the Ascii toggle visibly changes
+ // the art, which a 64x64 image cannot show (its cells average
+ // down to flat color and a block always wins).
const name = tok.next() orelse return error.BadScript;
var ppm: std.ArrayList(u8) = .empty;
- try ppm.appendSlice(arena, "P6\n64 64\n255\n");
+ try ppm.appendSlice(arena, "P6\n512 512\n255\n");
+ var seed: u64 = 12345;
var py: usize = 0;
- while (py < 64) : (py += 1) {
+ while (py < 512) : (py += 1) {
var px: usize = 0;
- while (px < 64) : (px += 1)
- try ppm.appendSlice(arena, if (px + py < 64) &[_]u8{ 255, 255, 255 } else &[_]u8{ 0, 0, 255 });
+ while (px < 512) : (px += 1) {
+ seed = seed *% 1103515245 +% 12345;
+ const v: u8 = @truncate(seed >> 16);
+ try ppm.appendSlice(arena, if (px + py < 512) &[_]u8{ v, v, v } else &[_]u8{ 0, 0, 255 });
+ }
}
try eh.writeFile(try arena.dupeZ(u8, name), ppm.items);
} else if (std.mem.eql(u8, cmd, "dirmk")) {