about summary refs log tree commit diff stats
path: root/shell/sandbox.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-04-27 23:10:30 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-04-27 23:10:30 -0700
commit55cde01edfe504855f171b6dbdc312cbcc02872b (patch)
treee39ebe42c53e6a8e906319faf6d318f4f6f6837d /shell/sandbox.mu
parent9e9e40c05a1a6df71f57f98044da4258ac013b5c (diff)
downloadmu-55cde01edfe504855f171b6dbdc312cbcc02872b.tar.gz
shell: stream literals
Diffstat (limited to 'shell/sandbox.mu')
-rw-r--r--shell/sandbox.mu17
1 files changed, 17 insertions, 0 deletions
diff --git a/shell/sandbox.mu b/shell/sandbox.mu
index ad5c0a15..68ea1060 100644
--- a/shell/sandbox.mu
+++ b/shell/sandbox.mu
@@ -885,6 +885,23 @@ fn test-run-multiple-expressions-after-dot {
   # further errors may occur
 }
 
+fn test-run-stream {
+  var sandbox-storage: sandbox
+  var sandbox/esi: (addr sandbox) <- address sandbox-storage
+  initialize-sandbox-with sandbox, "[a b]"
+  # eval
+  edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/no-screen, 0/no-tweak-screen
+  # setup: screen
+  var screen-on-stack: screen
+  var screen/edi: (addr screen) <- address screen-on-stack
+  initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics
+  #
+  render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height
+  check-screen-row screen, 0/y, "[a b]    ", "F - test-run-stream/0"
+  check-screen-row screen, 1/y, "...      ", "F - test-run-stream/1"
+  check-screen-row screen, 2/y, "=> [a b] ", "F - test-run-stream/2"
+}
+
 fn test-run-move-cursor-into-trace {
   var sandbox-storage: sandbox
   var sandbox/esi: (addr sandbox) <- address sandbox-storage