about summary refs log tree commit diff stats
path: root/archive/1.vm/086scenario_console_test.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-01 17:04:37 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-01 17:04:37 -0800
commit2a4088119cf41175457414dfa59bd4064b8f0562 (patch)
tree64fe184e399f9870ebd481a90eec34d51e5dff68 /archive/1.vm/086scenario_console_test.mu
parent23fd294d85959c6b476bcdc35ed6ad508cc99b8f (diff)
downloadmu-2a4088119cf41175457414dfa59bd4064b8f0562.tar.gz
5852
Diffstat (limited to 'archive/1.vm/086scenario_console_test.mu')
-rw-r--r--archive/1.vm/086scenario_console_test.mu25
1 files changed, 25 insertions, 0 deletions
diff --git a/archive/1.vm/086scenario_console_test.mu b/archive/1.vm/086scenario_console_test.mu
new file mode 100644
index 00000000..f5aa1438
--- /dev/null
+++ b/archive/1.vm/086scenario_console_test.mu
@@ -0,0 +1,25 @@
+# To check our support for consoles in scenarios, rewrite tests from
+# scenario_console.mu
+# Tests for console interface.
+
+scenario read-key-in-mu [
+  assume-console [
+    type [abc]
+  ]
+  run [
+    1:char, 2:bool <- read-key console
+    3:char, 4:bool <- read-key console
+    5:char, 6:bool <- read-key console
+    7:char, 8:bool <- read-key console
+  ]
+  memory-should-contain [
+    1 <- 97  # 'a'
+    2 <- 1
+    3 <- 98  # 'b'
+    4 <- 1
+    5 <- 99  # 'c'
+    6 <- 1
+    7 <- 0  # eof
+    8 <- 1
+  ]
+]