summaryrefslogtreecommitdiff
path: root/examples/noc/test/path_following.timeline.script
diff options
context:
space:
mode:
Diffstat (limited to 'examples/noc/test/path_following.timeline.script')
-rw-r--r--examples/noc/test/path_following.timeline.script61
1 files changed, 61 insertions, 0 deletions
diff --git a/examples/noc/test/path_following.timeline.script b/examples/noc/test/path_following.timeline.script
new file mode 100644
index 0000000..4f43163
--- /dev/null
+++ b/examples/noc/test/path_following.timeline.script
@@ -0,0 +1,61 @@
+# Timeline check (design.md "Acceptance: timeline"), from
+# accel_to_mouse.timeline.script. The interaction: clicks make new paths
+# from the State's generator, and space toggles the debugging lines, so a
+# replay that missed or doubled an input, or a seek that lost the
+# generator's state, ends elsewhere.
+
+# 1. Record.
+frames 60
+console record 0
+frames 30
+click 100 100
+frames 40
+key space
+frames 20
+click 500 300
+key space
+frames 30
+# 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 150
+expect-snapshot 2
+screenshot .zig-cache/e2e/path_following-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/path_following-sought.png
+# 7. What a seek shows equals what playing showed (draw-side caches).
+expect-same-screenshot .zig-cache/e2e/path_following-played.png .zig-cache/e2e/path_following-sought.png
+console seek 800
+console pause
+frames 10
+# Paused halfway, then on to the end.
+console pause
+frames 30
+console pause
+frames 150
+expect-snapshot 2
+
+# 4. Stepped: frame by frame from the start, then back and forth.
+console seek start
+console step 100000
+expect-snapshot 2
+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 150
+expect-snapshot 2
+console stop