diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 13:56:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 15:26:36 -0300 |
| commit | 3488111273764c17a42870484fabc36abb0634a1 (patch) | |
| tree | fa5440938b0feb1b0b38c3bca92326501a622413 /test/process | |
| parent | c2885d899c95b9c4a72786940289afd0b3ddbde8 (diff) | |
| download | pardes-3488111273764c17a42870484fabc36abb0634a1.tar.gz pardes-3488111273764c17a42870484fabc36abb0634a1.zip | |
effects out, the core's motion: the view's glide is the frontends' alone, and the core keeps no motion and no clock but its deadlines; glide.zig is a frontend's picture of a scroll, measured on the frame it is about to draw against the last it drew (a body's first line and the text it shows in its region, Region.doc new; the last frame's cells kept by the glide itself), on the frontend's own clock, the tty drawing it at whole rows and the window at the pixel; each frontend draws its own motions' frames from the last frame (the tty's poll presents it again, the window's loop renders it again, as its blink did) and paces its own waits, so the core's continuous path goes (Pardes.continuous and shell_continuous, the pump's one-millisecond wait, the view's drawn fields, the tape's watch of it); the Motion word and its five flavours go (the glide and the caret move at the default's pace, and no switch for reduced motion is left), and animation.zig with them (Motion and Spring gone, Follow now glide.zig's with its test, CursorGlide gone with the core's caret, Blink the window's with its test, Box and layout.panelBox gone, the frame's length now Pardes.frame_ns); a PDF strip no longer glides, its scroll landing at once (its follow, stripAt's motion and Pdf.moving go); the window's glide tests are fed frame by frame as the window feeds them; the window monkey runs by seed, not by flavour, and the 9P monkey loses Motion; the tty wakes a frame at a time while its glide or trail moves, as the core's continuous path woke it; all 109 snapshot goldens and the 16 GUI goldens unchanged; tests gone: a carried spring keeps its speed; a spring settles without overshoot; each flavour is its own motion; a cursor eases a cell at a time (animation.zig's); a PDF strip glides a notch and a page to their marks; a PDF glide renders the pages it crosses
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/process')
| -rw-r--r-- | test/process/window.zig | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/test/process/window.zig b/test/process/window.zig index 3a64d910..3d197c09 100644 --- a/test/process/window.zig +++ b/test/process/window.zig @@ -28,34 +28,29 @@ fn paneWith(f: *process.Files, word: []const u8) !u32 { return error.NoSuchPane; } -const motions = [_][]const u8{ "off", "crisp", "smooth", "bouncy", "playful" }; const themes = [_][]const u8{ "lapis", "forge", "acme", "dusk", "daybreak" }; -/// test/gui_monkey.py's: each Motion gets a random burst, then must -/// settle with its process alive and no crash record. Two of them and 30 -/// steps in process-test; PARDES_GUI_MONKEY=all runs all 5 (`zig build -/// monkey-gui`), PARDES_GUI_MONKEY_SEED and _STEPS choose the rest. +/// test/gui_monkey.py's: random bursts, each run then settling with its +/// process alive and no crash record. Two runs of 30 steps in +/// process-test; PARDES_GUI_MONKEY=all runs 5 (`zig build monkey-gui`), +/// PARDES_GUI_MONKEY_SEED and _STEPS choose the rest. fn monkey(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try process.only(.gui); const all = std.mem.eql(u8, envOr("PARDES_GUI_MONKEY", ""), "all"); const seed = try std.fmt.parseInt(u64, envOr("PARDES_GUI_MONKEY_SEED", "1"), 10); const steps = try std.fmt.parseInt(usize, envOr("PARDES_GUI_MONKEY_STEPS", if (all) "60" else "30"), 10); var failed: usize = 0; - var n: usize = 0; - for (motions) |m| { - defer n += 1; - // The smoke run: the quietest and the busiest. - if (!all and n != 0 and n != motions.len - 1) continue; - if (!try monkeyOne(gpa, exe, m, seed * 1000 + n, steps)) failed += 1; + for (0..@as(usize, if (all) 5 else 2)) |n| { + if (!try monkeyOne(gpa, exe, seed * 1000 + n, steps)) failed += 1; } if (failed > 0) return error.MonkeyFailed; } -fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, seed: u64, steps: usize) !bool { +fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, seed: u64, steps: usize) !bool { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - const init = try std.fmt.allocPrint(a, "Shell /bin/sh\nMessageLinger 0\nMotion {s}\n", .{motion}); + const init = "Shell /bin/sh\nMessageLinger 0\n"; var d = try process.Detached.start(gpa, exe, "monkey", .{ .init = init, .grid = .{ 80, 28 }, .env = &.{ .{ "PARDES_TEST_CLOCK", "1" }, .{ "PARDES_TEST_PAD", "0" }, } }); @@ -99,7 +94,7 @@ fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, seed }; } else |_| {} const ok = std.mem.eql(u8, verdict, "ok"); - if (!ok) std.debug.print("monkey {s} (seed {d}): {s}\n{s}", .{ motion, seed, verdict, log.items }); + if (!ok) std.debug.print("monkey (seed {d}): {s}\n{s}", .{ seed, verdict, log.items }); return ok; } |
