From 294b2ab35983ebe95698835bb54bca8bd3eec101 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 11 Dec 2016 16:18:18 -0800 Subject: 3705 - switch to tested file-system primitives --- html/edit/009-sandbox-test.mu.html | 45 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 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 30c731ea..b6e0ab9b 100644 --- a/html/edit/009-sandbox-test.mu.html +++ b/html/edit/009-sandbox-test.mu.html @@ -40,22 +40,25 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - recipes:text <- new [ -recipe foo [ - reply 4 -]] - env:&:environment <- new-programming-environment screen, recipes:text, [foo] + assume-resources [ + [lesson/recipes.mu] <- [ + |recipe foo [| + | reply 4| + |]| + ] + ] + env:&:environment <- new-programming-environment resources, screen, [foo] # run it assume-console [ press F4 ] - event-loop screen, console, env + event-loop screen, console, env, resources screen-should-contain [ . run (F4) . - . ╎ . - .recipe foo [ ╎─────────────────────────────────────────────────. - . reply 4 ╎0 edit copy delete . - .] ╎foo . + .recipe foo [ ╎ . + . reply 4 ╎─────────────────────────────────────────────────. + .] ╎0 edit copy delete . + . ╎foo . .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎4 . . ╎─────────────────────────────────────────────────. . ╎ . @@ -65,7 +68,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click 5, 51 ] run [ - event-loop screen, console, env + event-loop screen, console, env, resources ] # color toggles to green screen-should-contain-in-color 2/green, [ @@ -85,26 +88,24 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] screen-should-contain [ . run (F4) . - .␣ ╎ . - .recipe foo [ ╎─────────────────────────────────────────────────. - . reply 4 ╎0 edit copy delete . - .] ╎foo . + .␣ecipe foo [ ╎ . + . reply 4 ╎─────────────────────────────────────────────────. + .] ╎0 edit copy delete . + . ╎foo . .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎4 . . ╎─────────────────────────────────────────────────. . ╎ . - . ╎ . - . ╎ . ] # now change the result # then rerun assume-console [ - left-click 3, 11 # cursor to end of line + left-click 2, 11 # cursor to end of line press backspace type [3] press F4 ] run [ - event-loop screen, console, env + event-loop screen, console, env, resources ] # result turns red screen-should-contain-in-color 1/red, [ @@ -131,14 +132,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color expected-response:text <- get *curr, expected-response:offset break-unless expected-response filename <- append filename, [.out] - save filename, expected-response + resources <- dump resources, filename, expected-response } ] before <end-restore-sandbox> [ { filename <- append filename, [.out] - contents <- restore filename + contents <- slurp resources, filename break-unless contents *curr <- put *curr, expected-response:offset, contents } @@ -163,7 +164,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color break-unless sandbox # toggle its expected-response, and save session sandbox <- toggle-expected-response sandbox - save-sandboxes env + save-sandboxes env, resources hide-screen screen screen <- render-sandbox-side screen, env, render screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env -- cgit 1.4.1-2-gfad0