about summary refs log tree commit diff stats
path: root/090scenario_filesystem_test.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-20 18:29:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-20 18:29:09 -0700
commitebea4c3f4a3aed3bb0f6c16edd1d44eea965ca6b (patch)
tree0be5ca83da65d689db6acd0bc36509d046cf0d4f /090scenario_filesystem_test.mu
parentf09d9076f16dbc8104a8320f54251347b1387d9f (diff)
downloadmu-ebea4c3f4a3aed3bb0f6c16edd1d44eea965ca6b.tar.gz
3231 - reading from fake files in scenarios
Diffstat (limited to '090scenario_filesystem_test.mu')
-rw-r--r--090scenario_filesystem_test.mu23
1 files changed, 23 insertions, 0 deletions
diff --git a/090scenario_filesystem_test.mu b/090scenario_filesystem_test.mu
new file mode 100644
index 00000000..4d4624eb
--- /dev/null
+++ b/090scenario_filesystem_test.mu
@@ -0,0 +1,23 @@
+# Check our support for fake file systems in scenarios.
+
+scenario read-from-fake-file [
+  local-scope
+  assume-filesystem [
+    [a] <- [
+      |xyz|
+    ]
+  ]
+  contents:address:source:character <- start-reading filesystem:address:filesystem, [a]
+  1:character/raw <- read contents
+  2:character/raw <- read contents
+  3:character/raw <- read contents
+  4:character/raw <- read contents
+  _, 5:boolean/raw <- read contents
+  memory-should-contain [
+    1 <- 120  # x
+    2 <- 121  # y
+    3 <- 122  # z
+    4 <- 10  # newline
+    5 <- 1  # eof
+  ]
+]