about summary refs log tree commit diff stats
path: root/cpp/073scenario_screen_test.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-04 11:11:35 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-04 11:11:35 -0700
commit1fd41772092d1c9031c2921f47419bf2de31a528 (patch)
treeadf8f8de727d60658a248a7d92a05a8fe1e303b9 /cpp/073scenario_screen_test.mu
parenta66c9ae68122e04637d65c7f3aedcd96012c8cb6 (diff)
downloadmu-1fd41772092d1c9031c2921f47419bf2de31a528.tar.gz
1250
Diffstat (limited to 'cpp/073scenario_screen_test.mu')
-rw-r--r--cpp/073scenario_screen_test.mu29
1 files changed, 29 insertions, 0 deletions
diff --git a/cpp/073scenario_screen_test.mu b/cpp/073scenario_screen_test.mu
new file mode 100644
index 00000000..fa1a026c
--- /dev/null
+++ b/cpp/073scenario_screen_test.mu
@@ -0,0 +1,29 @@
+# To check our support for screens in scenarios, rewrite tests from print.mu
+
+scenario print-character-at-top-left2 [
+  assume-screen 3:literal/width, 2:literal/height
+  run [
+    screen:address <- print-character screen:address, 97:literal  # 'a'
+  ]
+  screen-should-contain [
+    .a  .
+    .   .
+  ]
+]
+
+scenario clear-line-erases-printed-characters2 [
+  assume-screen 5:literal/width, 3:literal/height
+  run [
+    # print a character
+    screen:address <- print-character screen:address, 97:literal  # 'a'
+    # move cursor to start of line
+    screen:address <- move-cursor screen:address, 0:literal/row, 0:literal/column
+    # clear line
+    screen:address <- clear-line screen:address
+  ]
+  screen-should-contain [
+    .     .
+    .     .
+    .     .
+  ]
+]