about summary refs log tree commit diff stats
path: root/076scenario_keyboard_test.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-05 21:17:24 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-05 21:17:24 -0700
commitb96af395b9af2ff9df94b3e82213171f30827c8d (patch)
tree17c8c12648ccc25625e2534ec8d74fbe8f1542cc /076scenario_keyboard_test.mu
parent2e3b597fe85b654e82b891c22d50754fa5a26156 (diff)
downloadmu-b96af395b9af2ff9df94b3e82213171f30827c8d.tar.gz
1276 - make C++ version the default
I've tried to update the Readme, but there are at least a couple of issues.
Diffstat (limited to '076scenario_keyboard_test.mu')
-rw-r--r--076scenario_keyboard_test.mu23
1 files changed, 23 insertions, 0 deletions
diff --git a/076scenario_keyboard_test.mu b/076scenario_keyboard_test.mu
new file mode 100644
index 00000000..67a965b1
--- /dev/null
+++ b/076scenario_keyboard_test.mu
@@ -0,0 +1,23 @@
+# To check our support for keyboards in scenarios, rewrite tests from
+# scenario_keyboard.mu
+# Tests for keyboard interface.
+
+scenario read-key-in-mu [
+  assume-keyboard [abc]
+  run [
+    1:character, 2:boolean, keyboard:address <- read-key keyboard:address
+    3:character, 4:boolean, keyboard:address <- read-key keyboard:address
+    5:character, 6:boolean, keyboard:address <- read-key keyboard:address
+    7:character, 8:boolean, keyboard:address <- read-key keyboard:address
+  ]
+  memory-should-contain [
+    1 <- 97  # 'a'
+    2 <- 1  # first read-key call found a character
+    3 <- 98  # 'b'
+    4 <- 1  # second read-key call found a character
+    5 <- 99  # 'c'
+    6 <- 1  # third read-key call found a character
+    7 <- 0
+    8 <- 0  # fourth read-key call didn't find a character
+  ]
+]