Skip to content
View source

Replay linesGenerated

Every line a .replay test may hold.

Name Kind Syntax
alike alike
allow allow file.write <dir> | allow file.delete <dir>
button button <name> down | up
clipboard clipboard "<text>"
expect expect <x> <y> = <r> <g> <b> [<tolerance>]
expect expect <node.port[i][.field]> = <value>... [<tolerance>]
expect expect <node.port[i][.field]> < | <= | > | >= <number>...
expect expect count <node.port> = <n>
expect expect placed <node> main | ordered
frame frame <seconds> [to <seconds> every <seconds>]
key key <code> down | up
library library <path>
pads pads <count>
param param <name> <literal>
pointer pointer [<x> <y>] [down | up]
reset reset [<node.port>]
scene scene <path>
settle settle
show show <node.port[i][.field]>
stick stick left | right | triggers <x> <y>
type type "<text>"
wheel wheel <x> <y>
window window <w> <h> [<scale>]
alike

its checks hold two forms of one computation equal word for word, which they are only where every Kernel rounds alike, so --round-apart leaves the replay out

Example

alike

allow file.write <dir> | allow file.delete <dir>

lets the scene’s outputs write (or remove and rename) files under the directory, relative to the replay file, as --allow does; what they write is kept for the run and never reaches the disk, so every run starts from the same files; with or without it, what the scene saved for itself before the run (an output’s file an input reads, with a fallback) is not read until the run writes it

Example

allow file.write../laws/

button <name> down | up

left, right, middle, or a pad’s south, east, west, north, l1, r1, l3, r3, start, select

Example

button right down
button south up

clipboard "<text>"

the clipboard holding this text from here on, as a person copying elsewhere leaves it: what an input = clipboard reads; the same escapes as type

Example

clipboard "from elsewhere"

expect <x> <y> = <r> <g> <b> [<tolerance>]

the picture’s color at x y from its top left, each channel 0 to 1 as the Kernel wrote it; tolerance 0.01 when not given

Example

expect 11 10 = 1.0 1.0 1.0
expect 11 10 = 1.0 1.0 1.0 0.05

expect <node.port[i][.field]> = <value>... [<tolerance>]

an element of a node’s output, or a field of it (a struct’s element is compared a field at a time; an array’s element is named by its index, .cells.2): ints and bools exactly, floats and vectors within the tolerance; i counts along the Field, x fastest, then y, then z

Example

expect step.result[0].score = 1
expect step.result[0].cells.2 = 0

expect <node.port[i][.field]> < | <= | > | >= <number>...

every component of it past a bound

Example

expect fall.result[0].speed > 2.5

expect count <node.port> = <n>

how many elements a node’s output holds

Example

expect count ground.result = 6889

expect placed <node> main | ordered

where a node runs: the session’s main backend, or ordered work off it; a session with one backend reads both as main

Example

expect placed ring main
expect placed filter ordered

frame <seconds> [to <seconds> every <seconds>]

evaluates one frame at this session time; with to and every, a frame at each step from the first time to the last, both included

Example

frame 0.0
frame 0.1 to 2.0 every 0.1

key <code> down | up

a key by the browser’s code, as key() reads it: letters and digits by uppercase ASCII, space 32, enter 13, arrows 37 to 40, the rest in help key

Example

key 67 down

library <path>

Kernels beyond the scene’s use

Example

library../kernels/

pads <count>

how many pads are connected from here on, what pads() reads

Example

pads 1

param <name> <literal>

sets a graph parameter

Example

param exposure 1.5

pointer [<x> <y>] [down | up]

moves the pointer, in the output’s pixels from its top left (what pointer() reads), and presses or releases it

Example

pointer 20 20 down
pointer up

reset [<node.port>]

forgets every node’s committed state, or one port’s

Example

reset
reset step.result

scene <path>

the scene to test, relative to the replay file; required

Example

scene../scene.esn

settle

waits for every async run to land

Example

settle

show <node.port[i][.field]>

prints an element of a node’s output after the last frame, or a field of it, a struct field by field; it checks nothing, and the run reports what it shows

Example

show step.result[0]
show step.result[0].score

stick left | right | triggers <x> <y>

a pad’s axis pair

Example

stick left 0.5 -1

type "<text>"

characters typed, what typed() reads on the next frame (32 a frame, the rest on the frames after); \", \\, \n and \t inside the quotes, # among them no comment

Example

type "你好, Quill"

wheel <x> <y>

the scroll for the next frame only

Example

wheel 0 -1

window <w> <h> [<scale>]

the window in pixels, for window(), and its scale factor; one when not given

Example

window 240 135
window 240 135 0.25