diff options
Diffstat (limited to 'examples/noc/test/bouncing_ball.reload.script')
| -rw-r--r-- | examples/noc/test/bouncing_ball.reload.script | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/noc/test/bouncing_ball.reload.script b/examples/noc/test/bouncing_ball.reload.script new file mode 100644 index 0000000..6eee3e7 --- /dev/null +++ b/examples/noc/test/bouncing_ball.reload.script @@ -0,0 +1,30 @@ +# Live reload (design.md "Acceptance: live reload"): play a while, pause a +# replay so State holds still, load the edited build ({v2}: a darker ball), +# check that State carried over and the picture changed where the edit shows. +frames 240 +console record 0 +frames 30 +console stop +console play 0 +frames 10 +console pause +frames 2 +expect position[0] 560 ~0.001 +expect position[1] 124 ~0.001 +expect velocity[1] -2 ~0.001 +screenshot .zig-cache/e2e/bouncing_ball-before.png +frames 1 +load {v2} +expect position[0] 560 ~0.001 +expect position[1] 124 ~0.001 +expect velocity[1] -2 ~0.001 +frames 2 +screenshot .zig-cache/e2e/bouncing_ball-after.png +frames 1 +expect-different-screenshot .zig-cache/e2e/bouncing_ball-before.png .zig-cache/e2e/bouncing_ball-after.png 538 102 48 48 +# Playing on after the reload: State goes on from where it was. +console pause +frames 10 +expect position[0] 535 ~0.001 +expect position[1] 104 ~0.001 +expect velocity[1] -2 ~0.001 |
