about summary refs log tree commit diff stats
path: root/403stream.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-07-31 16:05:35 -0700
committerKartik Agaram <vc@akkartik.com>2020-07-31 16:05:35 -0700
commit5c058ad6278a373a1ad0e251966447c8c6c86547 (patch)
treebf8d57970fbf1c4c5fd2198cffe5a9a64941275f /403stream.mu
parenta0da3604a2da396ac578accf32d4c3d39da7d0b0 (diff)
downloadmu-5c058ad6278a373a1ad0e251966447c8c6c86547.tar.gz
6692
Diffstat (limited to '403stream.mu')
-rw-r--r--403stream.mu7
1 files changed, 6 insertions, 1 deletions
diff --git a/403stream.mu b/403stream.mu
index 10e9e212..b57700f1 100644
--- a/403stream.mu
+++ b/403stream.mu
@@ -1,13 +1,15 @@
 # Tests for Mu's stream primitives.
 
 fn test-stream {
-  # write an int to a stream, then read it back
+  # - write an int to a stream, then read it back
+  # step 1: initialize
   var s: (stream int 4)
   var s2/ecx: (addr stream int 4) <- address s
   var tmp/eax: boolean <- stream-empty? s2
   check-true tmp, "F - test-stream/empty?/0"
   tmp <- stream-full? s2
   check-false tmp, "F - test-stream/full?/0"
+  # step 2: write to stream
   var x: int
   copy-to x, 0x34
   var x2/edx: (addr int) <- address x
@@ -16,6 +18,9 @@ fn test-stream {
   check-false tmp, "F - test-stream/empty?/1"
   tmp <- stream-full? s2
   check-false tmp, "F - test-stream/full?/1"
+  # step 3: modify the value written (should make no difference)
+  copy-to x, 0
+  # step 4: read back
   var y: int
   var y2/ebx: (addr int) <- address y
   read-from-stream s2, y2