From b301e0c0e6b54dceecbe4ee1ef8f610411015c30 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 27 Jan 2018 00:28:51 -0800 Subject: 4200 Forgot to set up exuberant_ctags_rc as .ctags on new laptop. --- html/edit/009-sandbox-test.mu.html | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'html/edit/009-sandbox-test.mu.html') diff --git a/html/edit/009-sandbox-test.mu.html b/html/edit/009-sandbox-test.mu.html index 5d8c0d2e..5d269e79 100644 --- a/html/edit/009-sandbox-test.mu.html +++ b/html/edit/009-sandbox-test.mu.html @@ -74,13 +74,13 @@ if ('onhashchange' in window) { 12 |]| 13 ] 14 ] - 15 env:&:environment <- new-programming-environment resources, screen, [foo] - 16 render-all screen, env, render + 15 env:&:environment <- new-programming-environment resources, screen, [foo] + 16 render-all screen, env, render 17 # run it 18 assume-console [ 19 press F4 20 ] - 21 event-loop screen, console, env, resources + 21 event-loop screen, console, env, resources 22 screen-should-contain [ 23 . run (F4) . 24 .recipe foo [ ╎ . @@ -97,7 +97,7 @@ if ('onhashchange' in window) { 35 left-click 5, 51 36 ] 37 run [ - 38 event-loop screen, console, env, resources + 38 event-loop screen, console, env, resources 39 ] 40 # color toggles to green 41 screen-should-contain-in-color 2/green, [ @@ -115,7 +115,7 @@ if ('onhashchange' in window) { 53 # cursor should remain unmoved 54 run [ 55 cursor:char <- copy 9251/␣ - 56 print screen, cursor + 56 print screen, cursor 57 ] 58 screen-should-contain [ 59 . run (F4) . @@ -136,7 +136,7 @@ if ('onhashchange' in window) { 74 press F4 75 ] 76 run [ - 77 event-loop screen, console, env, resources + 77 event-loop screen, console, env, resources 78 ] 79 # result turns red 80 screen-should-contain-in-color 1/red, [ @@ -158,26 +158,26 @@ if ('onhashchange' in window) { 96 ] 97 98 # include expected response when saving or restoring a sandbox - 99 before <end-save-sandbox> [ + 99 before <end-save-sandbox> [ 100 { 101 expected-response:text <- get *sandbox, expected-response:offset 102 break-unless expected-response 103 filename <- append filename, [.out] -104 resources <- dump resources, filename, expected-response +104 resources <- dump resources, filename, expected-response 105 } 106 ] 107 -108 before <end-restore-sandbox> [ +108 before <end-restore-sandbox> [ 109 { 110 filename <- append filename, [.out] -111 contents <- slurp resources, filename +111 contents <- slurp resources, filename 112 break-unless contents 113 *curr <- put *curr, expected-response:offset, contents 114 } 115 ] 116 117 # clicks on sandbox responses save it as 'expected' -118 after <global-touch> [ +118 after <global-touch> [ 119 # check if it's inside the output of any sandbox 120 { 121 sandbox-left-margin:num <- get *current-sandbox, left:offset @@ -191,27 +191,27 @@ if ('onhashchange' in window) { 129 below-sandbox-editor?:bool <- greater-or-equal click-row, first-sandbox-begins 130 break-unless below-sandbox-editor? 131 # identify the sandbox whose output is being clicked on -132 sandbox:&:sandbox, sandbox-index:num <- find-click-in-sandbox-output env, click-row +132 sandbox:&:sandbox, sandbox-index:num <- find-click-in-sandbox-output env, click-row 133 break-unless sandbox 134 # update it -135 sandbox <- toggle-expected-response sandbox +135 sandbox <- toggle-expected-response sandbox 136 # minimal update to disk -137 save-sandbox resources, sandbox, sandbox-index +137 save-sandbox resources, sandbox, sandbox-index 138 # minimal update to screen 139 sandbox-right-margin:num <- get *current-sandbox, right:offset -140 row:num <- render-sandbox-response screen, sandbox, sandbox-left-margin, sandbox-right-margin +140 row:num <- render-sandbox-response screen, sandbox, sandbox-left-margin, sandbox-right-margin 141 { -142 height:num <- screen-height screen +142 height:num <- screen-height screen 143 at-bottom?:bool <- greater-or-equal row, height 144 break-if at-bottom? -145 draw-horizontal screen, row, sandbox-left-margin, sandbox-right-margin +145 draw-horizontal screen, row, sandbox-left-margin, sandbox-right-margin 146 } -147 screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env +147 screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env 148 loop +next-event 149 } 150 ] 151 -152 def find-click-in-sandbox-output env:&:environment, click-row:num -> sandbox:&:sandbox, sandbox-index:num [ +152 def find-click-in-sandbox-output env:&:environment, click-row:num -> sandbox:&:sandbox, sandbox-index:num [ 153 local-scope 154 load-inputs 155 # assert click-row >= sandbox.starting-row-on-screen @@ -239,7 +239,7 @@ if ('onhashchange' in window) { 177 return sandbox, sandbox-index 178 ] 179 -180 def toggle-expected-response sandbox:&:sandbox -> sandbox:&:sandbox [ +180 def toggle-expected-response sandbox:&:sandbox -> sandbox:&:sandbox [ 181 local-scope 182 load-inputs 183 expected-response:text <- get *sandbox, expected-response:offset @@ -257,16 +257,16 @@ if ('onhashchange' in window) { 195 ] 196 197 # when rendering a sandbox, color it in red/green if expected response exists -198 after <render-sandbox-response> [ +198 after <render-sandbox-response> [ 199 { 200 break-unless sandbox-response 201 *sandbox <- put *sandbox, response-starting-row-on-screen:offset, row -202 row <- render-sandbox-response screen, sandbox, left, right +202 row <- render-sandbox-response screen, sandbox, left, right 203 jump +render-sandbox-end 204 } 205 ] 206 -207 def render-sandbox-response screen:&:screen, sandbox:&:sandbox, left:num, right:num -> row:num, screen:&:screen [ +207 def render-sandbox-response screen:&:screen, sandbox:&:sandbox, left:num, right:num -> row:num, screen:&:screen [ 208 local-scope 209 load-inputs 210 sandbox-response:text <- get *sandbox, response:offset @@ -274,21 +274,21 @@ if ('onhashchange' in window) { 212 row:num <- get *sandbox response-starting-row-on-screen:offset 213 { 214 break-if expected-response -215 row <- render-text screen, sandbox-response, left, right, 245/grey, row +215 row <- render-text screen, sandbox-response, left, right, 245/grey, row 216 return 217 } 218 response-is-expected?:bool <- equal expected-response, sandbox-response 219 { 220 break-if response-is-expected? -221 row <- render-text screen, sandbox-response, left, right, 1/red, row +221 row <- render-text screen, sandbox-response, left, right, 1/red, row 222 } 223 { 224 break-unless response-is-expected?:bool -225 row <- render-text screen, sandbox-response, left, right, 2/green, row +225 row <- render-text screen, sandbox-response, left, right, 2/green, row 226 } 227 ] 228 -229 before <end-render-sandbox-reset-hidden> [ +229 before <end-render-sandbox-reset-hidden> [ 230 *sandbox <- put *sandbox, response-starting-row-on-screen:offset, 0 231 ] -- cgit 1.4.1-2-gfad0