From 6933f99ddb2d7103515d26838496309a807bba26 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 21:28:20 -0300 Subject: Move standalone sketches into sketchbook examples --- examples/noc/test/random_walk.reload.script | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/noc/test/random_walk.reload.script (limited to 'examples/noc/test/random_walk.reload.script') diff --git a/examples/noc/test/random_walk.reload.script b/examples/noc/test/random_walk.reload.script new file mode 100644 index 0000000..9e60eff --- /dev/null +++ b/examples/noc/test/random_walk.reload.script @@ -0,0 +1,31 @@ +# Live reload (design.md "Acceptance: live reload"): play a while, pause a +# replay so State holds still, load the edited build ({v2}: red dots), +# check that State carried over and the picture changed where the edit shows. +# The reload jumps (`in.jumped`), so the whole trail is repainted, red. +frames 600 +console record 0 +frames 30 +console stop +console play 0 +frames 10 +console pause +frames 2 +expect walker.x 307 +expect walker.y 157 +expect clock.count 610 +screenshot .zig-cache/e2e/random_walk-before.png +frames 1 +load {v2} +expect walker.x 307 +expect walker.y 157 +expect clock.count 610 +# Playing on: the steps after the reload are drawn by the new code too. +console pause +frames 10 +expect walker.x 307 +expect walker.y 155 +expect clock.count 620 +screenshot .zig-cache/e2e/random_walk-after.png +frames 1 +expect-different-screenshot .zig-cache/e2e/random_walk-before.png .zig-cache/e2e/random_walk-after.png +expect-pixel .zig-cache/e2e/random_walk-after.png 307 155 255 0 0 255 -- cgit v1.3