I wrote a comment about how some code was not covered by tests, and then
promptly forgot what it was for. This is why we need tests.

Now the hack is gone.
This commit is contained in:
Kartik K. Agaram 2021-06-08 15:06:08 -07:00
parent a7008328cb
commit 67aeff8934
7 changed files with 99 additions and 72 deletions

View File

@ -26,7 +26,22 @@ $num-test-failures:end:
5d/pop-to-ebp
c3/return
running-tests?: # -> _/eax: int
# . prologue
55/push-ebp
89/<- %ebp 4/r32/esp
#
8b/-> *Running-tests? 0/r32/eax
$running-tests?:end:
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
c3/return
== data
Num-test-failures:
0/imm32
Running-tests?:
1/imm32/true

1
400.mu
View File

@ -19,6 +19,7 @@ sig read-mouse-event -> _/eax: int, _/ecx: int
# tests
sig count-test-failure
sig num-test-failures -> _/eax: int
sig running-tests? -> _/eax: boolean
sig string-equal? s: (addr array byte), benchmark: (addr array byte) -> _/eax: boolean
sig string-starts-with? s: (addr array byte), benchmark: (addr array byte) -> _/eax: boolean

View File

@ -21,6 +21,7 @@ Entry:
{
3d/compare-eax-and 0/imm32
75/jump-if-!= break/disp8
c7 0/subop/copy *Running-tests? 0/imm32/false
(clear-real-screen)
c7 0/subop/copy *Real-screen-cursor-x 0/imm32
c7 0/subop/copy *Real-screen-cursor-y 0/imm32

View File

@ -1,9 +1,9 @@
# The top-level data structure for the Mu shell.
#
# vim:textwidth&
# It would be nice for this test to use a narrower screen than the standard
# 0x80 of 1024 pixels with 8px-wide graphemes. But it complicates rendering
# logic, so we need longer lines than usual.
# It would be nice for tests to use a narrower screen than the standard 0x80 of
# 1024 pixels with 8px-wide graphemes. But it complicates rendering logic to
# make width configurable, so we just use longer lines than usual.
type environment {
globals: global-table
@ -23,9 +23,7 @@ fn test-environment {
var screen/edi: (addr screen) <- address screen-on-stack
initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics
#
edit-environment env, 0x61/a, 0/no-disk
render-environment screen, env
#? type-into-repl env, screen, "(define fn1 (fn() 42))"
type-into-repl env, screen, "(+ 3 4)" # we don't have any global definitions here, so no macros
# | global function definitions | sandbox
# top row blank for now
check-screen-row screen, 0/y, " ", "F - test-environment/0"
@ -38,16 +36,42 @@ fn test-environment {
check-screen-row screen, 5/y, " keyboard: ", "F - test-environment/5"
check-background-color-in-screen-row screen, 0/bg, 5/y, " ................ ", "F - test-environment/5-2"
check-screen-row screen, 6/y, " ", "F - test-environment/6"
check-screen-row screen, 7/y, " a ", "F - test-environment/7"
check-screen-row screen, 8/y, " ", "F - test-environment/8"
check-screen-row screen, 9/y, " ", "F - test-environment/9"
check-screen-row screen, 7/y, " (+ 3 4) ", "F - test-environment/7"
check-screen-row screen, 8/y, " ... trace depth: 4 ", "F - test-environment/8"
check-screen-row screen, 9/y, " => 7 ", "F - test-environment/9"
check-screen-row screen, 0xa/y, " ", "F - test-environment/0xa"
check-screen-row screen, 0xb/y, " ", "F - test-environment/0xb"
check-screen-row screen, 0xc/y, " ", "F - test-environment/0xc"
check-screen-row screen, 0xd/y, " ", "F - test-environment/0xd"
check-screen-row screen, 0xe/y, " ", "F - test-environment/0xe"
# bottom row is for a wordstar-style menu
check-screen-row screen, 0xf/y, " ^r run main ^s run sandbox ^g go to ^m to keyboard ^a << ^b <word ^f word> ^e >> ", "F - test-environment/0xf"
check-screen-row screen, 0xf/y, " ^r run main ^s run sandbox ^g go to ^m to trace ^a << ^b <word ^f word> ^e >> ", "F - test-environment/0xf"
}
fn test-definition-in-environment {
var env-storage: environment
var env/esi: (addr environment) <- address env-storage
initialize-environment env
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics
# define a function on the right (sandbox) side
type-into-repl env, screen, "(define fn1 (fn() 42))" # we don't have any global definitions here, so no macros
# | global function definitions | sandbox
check-screen-row screen, 0/y, " ", "F - test-definition-in-environment/0"
# function definition is now on the left side
check-screen-row screen, 1/y, " (define fn1 (fn() 42)) screen: ", "F - test-definition-in-environment/1"
check-background-color-in-screen-row screen, 0/bg, 1/y, " ........ ", "F - test-definition-in-environment/1-2"
check-background-color-in-screen-row screen, 0/bg, 2/y, " ........ ", "F - test-definition-in-environment/2"
check-background-color-in-screen-row screen, 0/bg, 3/y, " ........ ", "F - test-definition-in-environment/3"
check-screen-row screen, 4/y, " ", "F - test-definition-in-environment/4"
check-screen-row screen, 5/y, " keyboard: ", "F - test-definition-in-environment/5"
check-background-color-in-screen-row screen, 0/bg, 5/y, " ................ ", "F - test-definition-in-environment/5-2"
check-screen-row screen, 6/y, " ", "F - test-definition-in-environment/6"
check-screen-row screen, 7/y, " ", "F - test-definition-in-environment/7"
# you can still see the trace on the right for what you just added to the left
check-screen-row screen, 8/y, " ... trace depth: 4 ", "F - test-definition-in-environment/8"
}
# helper for testing
@ -68,8 +92,8 @@ fn type-into-repl self: (addr environment), screen: (addr screen), keys: (addr a
render-environment screen, self
loop
}
# hit 'enter'
edit-environment self, 0xa/newline, 0/no-disk
# submit
edit-environment self, 0x13/ctrl-s, 0/no-disk
render-environment screen, self
}
@ -191,7 +215,7 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d
edit-globals globals, key
}
# update sandbox whether the cursor is in globals or sandbox
edit-sandbox sandbox, key, globals, data-disk, 1/tweak-real-screen
edit-sandbox sandbox, key, globals, data-disk
}
return
}
@ -287,7 +311,7 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d
edit-globals globals, key
return
}
edit-sandbox sandbox, key, globals, data-disk, 1/tweak-real-screen
edit-sandbox sandbox, key, globals, data-disk
}
## details

View File

@ -9,13 +9,9 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han
# stack overflow? # disable when enabling Really-debug-print
check-stack
{
var screen-cell/eax: (addr handle cell) <- copy screen-cell
compare screen-cell, 0
break-if-=
var screen-cell-addr/eax: (addr cell) <- lookup *screen-cell
compare screen-cell-addr, 0
break-if-=
# if screen-cell exists, we're probably not in a test
var running-tests?/eax: boolean <- running-tests?
compare running-tests?, 0/false
break-if-!=
show-stack-state
}
# show intermediate progress on screen if necessary

View File

@ -402,7 +402,7 @@ fn test-macroexpand {
var sandbox-storage: sandbox
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))"
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk
# invoke macro
initialize-sandbox-with sandbox, "(m 3 4)"
var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data
@ -441,7 +441,7 @@ fn test-macroexpand-inside-anonymous-fn {
var sandbox-storage: sandbox
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))"
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk
# invoke macro
initialize-sandbox-with sandbox, "(fn() (m 3 4))"
var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data
@ -479,7 +479,7 @@ fn test-macroexpand-inside-fn-call {
var sandbox-storage: sandbox
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))"
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk
# invoke macro
initialize-sandbox-with sandbox, "((fn() (m 3 4)))"
var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data
@ -548,7 +548,7 @@ fn pending-test-macroexpand-inside-backquote-unquote {
var sandbox-storage: sandbox
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))"
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk
# invoke macro
initialize-sandbox-with sandbox, "`(print [result is ] ,(m 3 4)))"
var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data
@ -586,7 +586,7 @@ fn pending-test-macroexpand-inside-nested-backquote-unquote {
var sandbox-storage: sandbox
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))"
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk
# invoke macro
initialize-sandbox-with sandbox, "`(a ,(m 3 4) `(b ,(m 3 4) ,,(m 3 4)))"
var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data

View File

@ -470,7 +470,7 @@ fn render-keyboard-menu screen: (addr screen) {
draw-text-rightward-from-cursor screen, " to sandbox ", width, 7/fg, 0xc5/bg=blue-bg
}
fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-table), data-disk: (addr disk), tweak-real-screen?: boolean {
fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-table), data-disk: (addr disk) {
var self/esi: (addr sandbox) <- copy _self
# ctrl-s
{
@ -484,7 +484,7 @@ fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-tabl
# persisted until the next call to ctrl-s.
store-state data-disk, self, globals
#
run-sandbox self, globals, tweak-real-screen?
run-sandbox self, globals
return
}
# ctrl-m
@ -603,7 +603,7 @@ fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-tabl
# rerun at higher depth
var max-depth-addr/ecx: (addr int) <- get trace, max-depth
increment *max-depth-addr
run-sandbox self, globals, tweak-real-screen?
run-sandbox self, globals
# recompute cached indices
recompute-all-visible-lines trace
var save-addr/ecx: (addr trace-index-stash) <- address save
@ -615,7 +615,7 @@ fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-tabl
}
# hack: tweak-real-screen guards things there are no tests for
fn run-sandbox _self: (addr sandbox), globals: (addr global-table), tweak-real-screen?: boolean {
fn run-sandbox _self: (addr sandbox), globals: (addr global-table) {
var self/esi: (addr sandbox) <- copy _self
var data-ah/ecx: (addr handle gap-buffer) <- get self, data
var value-ah/eax: (addr handle stream byte) <- get self, value
@ -625,20 +625,10 @@ fn run-sandbox _self: (addr sandbox), globals: (addr global-table), tweak-real-s
var _trace/eax: (addr trace) <- lookup *trace-ah
var trace/ebx: (addr trace) <- copy _trace
clear-trace trace
{
compare tweak-real-screen?, 0/false
break-if-=
clear-sandbox-output 0/screen, self, 0x56/sandbox-left-margin, 1/y, 0x80/screen-width, 0x2f/screen-height-without-menu
}
var screen-cell/eax: (addr handle cell) <- get self, screen-var
clear-screen-cell screen-cell
var keyboard-cell/esi: (addr handle cell) <- get self, keyboard-var
rewind-keyboard-cell keyboard-cell # don't clear keys from before
{
compare tweak-real-screen?, 0/false
break-if-=
set-cursor-position 0/screen, 0/x, 0/y # for any debug prints during evaluation
}
run data-ah, value, globals, trace, screen-cell, keyboard-cell
}
@ -727,7 +717,7 @@ fn test-run-integer {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "1"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -745,7 +735,7 @@ fn test-run-negative-integer {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "-1"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -763,7 +753,7 @@ fn test-run-error-invalid-integer {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "1a"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -781,7 +771,7 @@ fn test-run-error-unknown-symbol {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "a"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -799,7 +789,7 @@ fn test-run-with-spaces {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, " 1 \n"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -818,7 +808,7 @@ fn test-run-quote {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "'a"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -836,7 +826,7 @@ fn test-run-dotted-list {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "'(a . b)"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -854,7 +844,7 @@ fn test-run-dot-and-list {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "'(a . (b))"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -872,7 +862,7 @@ fn test-run-final-dot {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "'(a .)"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -891,7 +881,7 @@ fn test-run-double-dot {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "'(a . .)"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -910,7 +900,7 @@ fn test-run-multiple-expressions-after-dot {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "'(a . b c)"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -929,7 +919,7 @@ fn test-run-stream {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "[a b]"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -947,7 +937,7 @@ fn test-run-move-cursor-into-trace {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "12"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -962,7 +952,7 @@ fn test-run-move-cursor-into-trace {
check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/pre-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/pre-2/cursor"
# move cursor into trace
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk
#
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
# skip one line of padding
@ -973,7 +963,7 @@ fn test-run-move-cursor-into-trace {
check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/trace-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/trace-2/cursor"
# move cursor into input
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk
#
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
# skip one line of padding
@ -1009,7 +999,7 @@ fn test-run-expand-trace {
var sandbox/esi: (addr sandbox) <- address sandbox-storage
initialize-sandbox-with sandbox, "12"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -1024,7 +1014,7 @@ fn test-run-expand-trace {
check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre0-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre0-2/cursor"
# move cursor into trace
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk
#
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
# skip one line of padding
@ -1035,7 +1025,7 @@ fn test-run-expand-trace {
check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre1-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre1-2/cursor"
# expand
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk
#
clear-screen screen
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
@ -1056,7 +1046,7 @@ fn test-run-can-rerun-when-expanding-trace {
# initialize sandbox with a max-depth of 3
initialize-sandbox-with sandbox, "12"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -1071,7 +1061,7 @@ fn test-run-can-rerun-when-expanding-trace {
check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre0-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre0-2/cursor"
# move cursor into trace
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk
#
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
# skip one line of padding
@ -1082,7 +1072,7 @@ fn test-run-can-rerun-when-expanding-trace {
check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre1-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre1-2/cursor"
# expand
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk
#
clear-screen screen
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
@ -1096,9 +1086,9 @@ fn test-run-can-rerun-when-expanding-trace {
check-screen-row screen, 4/y, " 1 pars", "F - test-run-can-rerun-when-expanding-trace/pre2-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-2/cursor"
# move cursor down and expand
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk
#
clear-screen screen
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
@ -1121,7 +1111,7 @@ fn test-run-preserves-trace-view-on-rerun {
# initialize sandbox with a max-depth of 3
initialize-sandbox-with sandbox, "7"
# eval
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk
# setup: screen
var screen-on-stack: screen
var screen/edi: (addr screen) <- address screen-on-stack
@ -1136,7 +1126,7 @@ fn test-run-preserves-trace-view-on-rerun {
check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre0-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre0-2/cursor"
# move cursor into trace
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
#
check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-0"
@ -1146,7 +1136,7 @@ fn test-run-preserves-trace-view-on-rerun {
check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-2"
check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre1-2/cursor"
# expand
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk
clear-screen screen
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
#
@ -1167,15 +1157,15 @@ fn test-run-preserves-trace-view-on-rerun {
check-screen-row screen, 8/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-7"
check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-7/cursor"
# move cursor down below the macroexpand line and expand
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
#
check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-0"
@ -1195,7 +1185,7 @@ fn test-run-preserves-trace-view-on-rerun {
check-screen-row screen, 8/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-7"
check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-7/cursor"
# expand
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/no-tweak-screen
edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk
clear-screen screen
render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor
# cursor line is expanded