about summary refs log tree commit diff stats
path: root/cpp/071print.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-30 10:12:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-30 10:12:36 -0700
commit2ffa3edefb6ec461d440b32c2d40ef4305535845 (patch)
tree5a0e0263b747d3ad1977c7e56fbf0996b7bbabd4 /cpp/071print.mu
parent72c4fb2ddacc9fccb8ebe8cba9d1322ddcaac017 (diff)
downloadmu-2ffa3edefb6ec461d440b32c2d40ef4305535845.tar.gz
1227
Diffstat (limited to 'cpp/071print.mu')
-rw-r--r--cpp/071print.mu25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpp/071print.mu b/cpp/071print.mu
index bd7f2411..b34f9844 100644
--- a/cpp/071print.mu
+++ b/cpp/071print.mu
@@ -154,6 +154,31 @@ recipe move-cursor [
   reply x:address:screen/same-as-ingredient:0
 ]
 
+scenario clear-line-erases-printed-characters [
+  run [
+#?     $start-tracing #? 3
+    1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height
+    # print a character
+    1:address:screen <- print-character 1:address:screen, 97:literal  # 'a'
+    # move cursor to start of line
+    1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column
+    # clear line
+    1:address:screen <- clear-line 1:address:screen
+    2:address:array:character <- get 1:address:screen/deref, data:offset
+    3:array:character <- copy 2:address:array:character/deref
+  ]
+  # screen should be blank
+  memory should contain [
+    3 <- 6  # width*height
+    4 <- 0
+    5 <- 0
+    6 <- 0
+    7 <- 0
+    8 <- 0
+    9 <- 0
+  ]
+]
+
 recipe cursor-down [
   default-space:address:array:location <- new location:type, 30:literal
   x:address:screen <- next-ingredient