summaryrefslogtreecommitdiff
path: root/examples/live/test/live.script
diff options
context:
space:
mode:
Diffstat (limited to 'examples/live/test/live.script')
-rw-r--r--examples/live/test/live.script22
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/live/test/live.script b/examples/live/test/live.script
index 22085bf..695d16a 100644
--- a/examples/live/test/live.script
+++ b/examples/live/test/live.script
@@ -1,4 +1,6 @@
-# A program typed, its tapes after each line, a broken line and its mend.
+# A program typed, its tapes after each line, a broken line and its mend;
+# then this run's session played back, and sought to two moments marked as
+# they happened. (A mark ends a clip, `record`, so the session is replayed.)
# Screenshots land in .zig-cache/live/ for review; they are compared over
# the picture alone (640,300 600x300: not the text, the scope or the time).
frames 2
@@ -16,6 +18,7 @@ expect color.len 4
expect color.code[0].op x
expect color.code[3].op hsv
frames 2
+console save typed
screenshot .zig-cache/live/gradient.png
# An edit: y becomes x, and the picture changes.
key backspace
@@ -39,3 +42,20 @@ expect-same-screenshot .zig-cache/live/edited.png .zig-cache/live/broken.png 0 6
type )
expect problem.len 0
expect color.len 3
+console save end
+# Played back from the start, then sought: each moment's text, tapes and
+# time as they were live, leaf by leaf (a mark is taken before its frame's
+# tick: 0.2667 s and 0.4833 s; a seek lands on the last frame at or before).
+console play session 0
+frames 100
+console seek 488
+expect-snapshot end
+console seek 272
+expect-snapshot typed
+expect color.len 4
+screenshot .zig-cache/live/sought.png
+expect-same-screenshot .zig-cache/live/gradient.png .zig-cache/live/sought.png 0 0 0 1000 600
+# Live again from there: the typed program, before its edit.
+console stop
+expect len 53
+expect color.code[3].op hsv