From d31037ffdcdb8097b91af121a27ef18c15f7e802 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 22 Apr 2016 22:53:39 -0700 Subject: 2854 - purge get-address from sandbox/ app --- sandbox/008-sandbox-test.mu | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'sandbox/008-sandbox-test.mu') diff --git a/sandbox/008-sandbox-test.mu b/sandbox/008-sandbox-test.mu index b64a5980..acd4c04d 100644 --- a/sandbox/008-sandbox-test.mu +++ b/sandbox/008-sandbox-test.mu @@ -98,8 +98,7 @@ before [ ] before [ - expected-response:address:address:shared:array:character <- get-address **curr, expected-response:offset - *expected-response <- copy contents + *curr <- put *curr, expected-response:offset, contents ] # clicks on sandbox responses save it as 'expected' @@ -160,24 +159,25 @@ def find-click-in-sandbox-output env:address:shared:programming-environment-data def toggle-expected-response sandbox:address:shared:sandbox-data -> sandbox:address:shared:sandbox-data [ local-scope load-ingredients - expected-response:address:address:shared:array:character <- get-address *sandbox, expected-response:offset + expected-response:address:shared:array:character <- get *sandbox, expected-response:offset { # if expected-response is set, reset - break-unless *expected-response - *expected-response <- copy 0 - return sandbox/same-as-ingredient:0 + break-unless expected-response + *sandbox <- put *sandbox, expected-response:offset, 0 + } + { + # if not, set expected response to the current response + break-if expected-response + response:address:shared:array:character <- get *sandbox, response:offset + *sandbox <- put *sandbox, expected-response:offset, response } - # if not, current response is the expected response - response:address:shared:array:character <- get *sandbox, response:offset - *expected-response <- copy response ] # when rendering a sandbox, color it in red/green if expected response exists after [ { break-unless sandbox-response - response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset - *response-starting-row <- copy row + *sandbox <- put *sandbox, response-starting-row-on-screen:offset, row expected-response:address:shared:array:character <- get *sandbox, expected-response:offset break-unless expected-response # fall-through to print in grey response-is-expected?:boolean <- equal expected-response, sandbox-response @@ -194,6 +194,5 @@ after [ ] before [ - tmp:address:number <- get-address *sandbox, response-starting-row-on-screen:offset - *tmp <- copy 0 + *sandbox <- put *sandbox, response-starting-row-on-screen:offset, 0 ] -- cgit 1.4.1-2-gfad0