diff options
Diffstat (limited to 'examples/noc/test/random_walk.timeline.script')
| -rw-r--r-- | examples/noc/test/random_walk.timeline.script | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/examples/noc/test/random_walk.timeline.script b/examples/noc/test/random_walk.timeline.script new file mode 100644 index 0000000..3bc8831 --- /dev/null +++ b/examples/noc/test/random_walk.timeline.script @@ -0,0 +1,57 @@ +# Timeline check (design.md "Acceptance: timeline"), from +# accel_to_mouse.timeline.script. No input; the walk is the State's +# generator. The trail is drawn from Session (src/trail.zig), so 7. checks +# that a seek repaints exactly what playing painted. + +# 1. Record. +frames 60 +console record 0 +frames 100 +# Saving stops the recording first: slot 2 is the state at the stop. +console save 2 + +# 2. Played to the end (one recorded frame per script frame), exactly. +console play 0 +frames 120 +expect-snapshot 2 +screenshot .zig-cache/e2e/random_walk-played.png +# 5. Paused (at the end): `draw` must not move State. +frames 30 +expect-snapshot 2 + +# 3. Sought to the end, and to the middle and played on. +console seek end +expect-snapshot 2 +screenshot .zig-cache/e2e/random_walk-sought.png +# 7. What a seek shows equals what playing showed (draw-side caches). +expect-same-screenshot .zig-cache/e2e/random_walk-played.png .zig-cache/e2e/random_walk-sought.png +console seek 800 +console pause +frames 10 +# Paused halfway, then on to the end. +console pause +frames 30 +console pause +frames 120 +expect-snapshot 2 + +# 4. Stepped: frame by frame from the start, then back and forth. +console seek start +console step 100000 +expect-snapshot 2 +# The seek to the start wiped the trail, and stepping repainted it all: +# the same picture as playing. +screenshot .zig-cache/e2e/random_walk-stepped.png +expect-same-screenshot .zig-cache/e2e/random_walk-played.png .zig-cache/e2e/random_walk-stepped.png +console step -25 +console step 25 +expect-snapshot 2 + +# 6. A live pointer move, then the same replay. +console stop +move 20 20 +frames 10 +console play 0 +frames 120 +expect-snapshot 2 +console stop |
