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>] |
Property descriptions
Section titled “Property descriptions”alikeits 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
alikeallow 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
Section titled “button”button <name> down | upleft, right, middle, or a pad’s south, east, west, north, l1, r1, l3, r3, start, select
Example
button right downbutton south upclipboard
Section titled “clipboard”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
Section titled “expect”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.0expect 11 10 = 1.0 1.0 1.0 0.05expect
Section titled “expect”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 = 1expect step.result[0].cells.2 = 0expect
Section titled “expect”expect <node.port[i][.field]> < | <= | > | >= <number>...every component of it past a bound
Example
expect fall.result[0].speed > 2.5expect
Section titled “expect”expect count <node.port> = <n>how many elements a node’s output holds
Example
expect count ground.result = 6889expect
Section titled “expect”expect placed <node> main | orderedwhere 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 mainexpect placed filter orderedframe <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.0frame 0.1 to 2.0 every 0.1key <code> down | upa 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 downlibrary
Section titled “library”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 1param <name> <literal>sets a graph parameter
Example
param exposure 1.5pointer
Section titled “pointer”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 downpointer upreset [<node.port>]forgets every node’s committed state, or one port’s
Example
resetreset step.resultscene <path>the scene to test, relative to the replay file; required
Example
scene../scene.esnsettle
Section titled “settle”settlewaits for every async run to land
Example
settleshow <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].scorestick left | right | triggers <x> <y>a pad’s axis pair
Example
stick left 0.5 -1type "<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 -1window
Section titled “window”window <w> <h> [<scale>]the window in pixels, for window(), and its scale factor; one when not given
Example
window 240 135window 240 135 0.25
