From 8beff53e5a65ac23411221fdcf6e9607b6c2a715 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 10 Sep 2015 19:22:27 -0700 Subject: 2180 - render the trace even if there's warnings --- edit/010-warnings.mu | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'edit/010-warnings.mu') diff --git a/edit/010-warnings.mu b/edit/010-warnings.mu index 6605f672..f5244a8d 100644 --- a/edit/010-warnings.mu +++ b/edit/010-warnings.mu @@ -63,12 +63,14 @@ recipe! update-sandbox [ } ] -after [ +# make sure we render any trace +after [ { sandbox-warnings:address:array:character <- get *sandbox, warnings:offset break-unless sandbox-warnings *response-starting-row <- copy 0 # no response row, screen <- render-string screen, sandbox-warnings, left, right, 1/red, row + # don't try to print anything more for this sandbox jump +render-sandbox-end:label } ] @@ -387,3 +389,52 @@ scenario sandbox-can-handle-infinite-loop [ . ┊ . ] ] + +scenario sandbox-with-warnings-shows-trace [ + $close-trace # trace too long + assume-screen 100/width, 10/height + # generate a stash and a warning + 1:address:array:character <- new [recipe foo [ +local-scope +a:number <- next-ingredient +b:number <- next-ingredient +stash [dividing by], b +_, c:number <- divide-with-remainder a, b +reply b +]] + 2:address:array:character <- new [foo 4, 0] + 3:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character, 2:address:array:character + # run + assume-console [ + press F4 + ] + event-loop screen:address, console:address, 3:address:programming-environment-data + # screen prints error message + screen-should-contain [ + . run (F4) . + .recipe foo \\\[ ┊ . + .local-scope ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + .a:number <- next-ingredient ┊ x. + .b:number <- next-ingredient ┊foo 4, 0 . + .stash [dividing by], b ┊foo: divide by zero in '_, c:number <- divide-wi↩. + ._, c:number <- divide-with-remainder a, b ┊th-remainder a, b' . + ] + # click on the call in the sandbox + assume-console [ + left-click 4, 55 + ] + run [ + event-loop screen:address, console:address, 3:address:programming-environment-data + ] + # screen should expand trace + screen-should-contain [ + . run (F4) . + .recipe foo \\\[ ┊ . + .local-scope ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + .a:number <- next-ingredient ┊ x. + .b:number <- next-ingredient ┊foo 4, 0 . + .stash [dividing by], b ┊dividing by 0 . + ._, c:number <- divide-with-remainder a, b ┊foo: divide by zero in '_, c:number <- divide-wi↩. + .reply b ┊th-remainder a, b' . + ] +] -- cgit 1.4.1-2-gfad0