From 76755b2836b0dadd88f82635f661f9d9df77604d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 10 Nov 2015 21:35:42 -0800 Subject: 2423 - describe shape-shifting in html docs --- html/edit/008-sandbox-test.mu.html | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'html/edit/008-sandbox-test.mu.html') diff --git a/html/edit/008-sandbox-test.mu.html b/html/edit/008-sandbox-test.mu.html index 0cdd6a08..08b62ddc 100644 --- a/html/edit/008-sandbox-test.mu.html +++ b/html/edit/008-sandbox-test.mu.html @@ -13,14 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } +.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } .muScenario { color: #00af00; } .Special { color: #ff6060; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } .Delimiter { color: #a04060; } -.muControl { color: #c0a020; } --> @@ -35,25 +35,25 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ## clicking on sandbox results to 'fix' them and turn sandboxes into tests scenario sandbox-click-on-result-toggles-color-to-green [ - $close-trace # trace too long + trace-until 100/app # trace too long assume-screen 40/width, 10/height # basic recipe 1:address:array:character <- new [ recipe foo [ - add 2, 2 + reply 4 ]] # run it 2:address:array:character <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character, 2:address:array:character - event-loop screen:address, console:address, 3:address:programming-environment-data + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . add 2, 2 ┊ x. + . reply 4 ┊ x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . . ┊━━━━━━━━━━━━━━━━━━━. @@ -64,7 +64,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } left-click 5, 21 ] run [ - event-loop screen:address, console:address, 3:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data ] # color toggles to green screen-should-contain-in-color 2/green, [ @@ -79,19 +79,19 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] # cursor should remain unmoved run [ - print-character screen:address, 9251/␣/cursor + print-character screen:address:screen, 9251/␣/cursor ] screen-should-contain [ . run (F4) . .␣ ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . add 2, 2 ┊ x. + . reply 4 ┊ x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . . ┊━━━━━━━━━━━━━━━━━━━. . ┊ . ] - # now change the second arg of the 'add' + # now change the result # then rerun assume-console [ left-click 3, 11 # cursor to end of line @@ -100,7 +100,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } press F4 ] run [ - event-loop screen:address, console:address, 3:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data ] # result turns red screen-should-contain-in-color 1/red, [ @@ -109,7 +109,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } . . . . . . - . 5 . + . 3 . . . . . ] @@ -117,7 +117,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } # clicks on sandbox responses save it as 'expected' after <global-touch> [ - # right side of screen? check if it's inside the output of any sandbox + # check if it's inside the output of any sandbox { sandbox-left-margin:number <- get *current-sandbox, left:offset click-column:number <- get *t, column:offset @@ -144,10 +144,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } } ] -recipe find-click-in-sandbox-output [ +recipe find-click-in-sandbox-output env:address:programming-environment-data, click-row:number -> sandbox:address:sandbox-data [ local-scope - env:address:programming-environment-data <- next-ingredient - click-row:number <- next-ingredient + load-ingredients # assert click-row >= sandbox.starting-row-on-screen sandbox:address:sandbox-data <- get *env, sandbox:offset start:number <- get *sandbox, starting-row-on-screen:offset @@ -171,9 +170,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } reply sandbox ] -recipe toggle-expected-response [ +recipe toggle-expected-response sandbox:address:sandbox-data -> sandbox:address:sandbox-data [ local-scope - sandbox:address:sandbox-data <- next-ingredient + load-ingredients expected-response:address:address:array:character <- get-address *sandbox, expected-response:offset { # if expected-response is set, reset @@ -184,7 +183,6 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } # if not, current response is the expected response response:address:array:character <- get *sandbox, response:offset *expected-response <- copy response - reply sandbox/same-as-ingredient:0 ] # when rendering a sandbox, color it in red/green if expected response exists -- cgit 1.4.1-2-gfad0