summaryrefslogtreecommitdiff
path: root/examples/live/test/live.script
blob: 386ab33df4401538c2114e2f5702ee924712431c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# A program typed, its tapes after each line, a broken line and its mend.
# Screenshots land in .zig-cache/live/ for review.
frames 2
type out = sin(tau * 220 * t) * 0.3
expect problem.len 0
expect out.len 8
expect out.code[5].op sin
expect out.code[7].op mul
key return
type color = hsv(x, 0.5, y)
expect color.len 4
expect color.code[0].op x
expect color.code[3].op hsv
frames 2
screenshot .zig-cache/live/gradient.png
# An edit: y becomes x, and the picture changes.
key backspace
key backspace
type x)
expect color.len 3
expect color.code[2].op hsv
expect color.code[2].c 0
frames 2
screenshot .zig-cache/live/edited.png
expect-different-screenshot .zig-cache/live/gradient.png .zig-cache/live/edited.png 640 300 600 380
# Broken: the tape and the picture stay, the problem is set at its byte.
key backspace
expect problem.at 52
expect color.len 3
expect color.code[2].c 0
frames 2
screenshot .zig-cache/live/broken.png
expect-same-screenshot .zig-cache/live/edited.png .zig-cache/live/broken.png 0 640 300 600 380
# Mended.
type )
expect problem.len 0
expect color.len 3