summaryrefslogtreecommitdiff
path: root/test/snapshot.zig
diff options
context:
space:
mode:
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")) {