about summary refs log tree commit diff stats
path: root/403stream.mu
diff options
context:
space:
mode:
Diffstat (limited to '403stream.mu')
-rw-r--r--403stream.mu15
1 files changed, 15 insertions, 0 deletions
diff --git a/403stream.mu b/403stream.mu
new file mode 100644
index 00000000..e7661658
--- /dev/null
+++ b/403stream.mu
@@ -0,0 +1,15 @@
+# Tests for Mu's stream primitives.
+
+fn test-stream {
+  # write an int to a stream, then read it back
+  var s: (stream int 4)
+  var s2/ecx: (addr stream int 4) <- address s
+  var x: int
+  copy-to x, 0x34
+  var x2/edx: (addr int) <- address x
+  write-to-stream s2, x2
+  var y: int
+  var y2/ebx: (addr int) <- address y
+  read-from-stream s2, y2
+  check-ints-equal y, 0x34, "F - test-stream"
+}