blob: 1c19d3fff134cd3c272d09189e1a7acb417a5670 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# A recording replays to the state it stopped at: played, seeked, stepped,
# resumed from the middle, and after the live pointer moved elsewhere.
# The button is down before recording starts: the recording begins with it.
move 100 80
down 100 80
console snapshot 1
console record 0
frames 5
move 300 200
frames 5
up 300 200
hold left_shift
move 500 300
frames 3
click 400 100
release left_shift
click 120 140
frames 20
# Saving stops the recording first: slot 2 holds the state at the stop.
console save 2
# The button held from before the recording came up at 300,200.
expect dots.len 3
expect dots.buffer[0].pos[0] 300
expect dots.buffer[1].kind big
expect dots.buffer[1].pos[0] 400
expect dots.buffer[2].pos[1] 140
expect dots.buffer[2].kind small
expect position[0] 120 ~60
console set dots.buffer[3].pos[1] 7.5
expect dots.buffer[3].pos[1] 7.5
# Reading takes no frame: `print` and `console get` leave `updates` alone,
# and vectors and structs print every value in them.
expect updates 46
print dots.buffer[1]
console get dots.buffer[0].pos
expect-log dots.buffer[0].pos = { 300, 200 }
console get dots.buffer[1]
expect-log dots.buffer[1] = { .pos[0] = 400, .pos[1] = 100, .kind = .big }
expect updates 46
# Played to the end, one recorded frame per frame.
console play 0
frames 60
expect-snapshot 2
# Paused at the end: the state does not move.
frames 10
expect-snapshot 2
console seek end
expect-snapshot 2
console seek start
console step 1000
expect-snapshot 2
console step -7
console step 7
expect-snapshot 2
# From the middle, played on.
console seek 200
console pause
frames 60
expect-snapshot 2
console diff 2
expect-log same
# A live move, then the same replay.
console stop
move 600 20
down 600 20
frames 3
console play 0
frames 60
expect-snapshot 2
expect-no-log another build
console stop
|