about summary refs log tree commit diff stats
path: root/083scenario_screen_test.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-28 19:48:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-28 19:48:56 -0700
commit6f65d5918f4b73de56e6cb6362c7cbc7dbbe5945 (patch)
treedec4043f2d62f5dd02156d369e20af247881e2ac /083scenario_screen_test.mu
parent1627d836b46440f57d766b154ec488fa2e5a1e06 (diff)
downloadmu-6f65d5918f4b73de56e6cb6362c7cbc7dbbe5945.tar.gz
3429 - standardize Mu scenarios
A long-standing problem has been that I couldn't spread code across
'run' blocks because they were separate scopes, so I've ended up making
them effectively comments. Running code inside a 'run' block is
identical in every way to simply running the code directly. The 'run'
block is merely a visual aid to separate setup from the component under
test.

In the process I've also standardized all Mu scenarios to always run in
a local scope, and only use (raw) numeric addresses for values they want
to check later.
Diffstat (limited to '083scenario_screen_test.mu')
-rw-r--r--083scenario_screen_test.mu15
1 files changed, 7 insertions, 8 deletions
diff --git a/083scenario_screen_test.mu b/083scenario_screen_test.mu
index c10da8e6..a21a9fdf 100644
--- a/083scenario_screen_test.mu
+++ b/083scenario_screen_test.mu
@@ -1,9 +1,9 @@
 # To check our support for screens in scenarios, rewrite tests from print.mu
 
 scenario print-character-at-top-left-2 [
+  local-scope
   assume-screen 3/width, 2/height
   run [
-    local-scope
     a:char <- copy 97/a
     screen:&:screen <- print screen:&:screen, a
   ]
@@ -14,15 +14,14 @@ scenario print-character-at-top-left-2 [
 ]
 
 scenario clear-line-erases-printed-characters-2 [
+  local-scope
   assume-screen 5/width, 3/height
+  # print a character
+  a:char <- copy 97/a
+  screen:&:screen <- print screen:&:screen, a
+  # move cursor to start of line
+  screen:&:screen <- move-cursor screen:&:screen, 0/row, 0/column
   run [
-    local-scope
-    # print a character
-    a:char <- copy 97/a
-    screen:&:screen <- print screen:&:screen, a
-    # move cursor to start of line
-    screen:&:screen <- move-cursor screen:&:screen, 0/row, 0/column
-    # clear line
     screen:&:screen <- clear-line screen:&:screen
   ]
   screen-should-contain [