[MLton-commit] r5361

Vesa Karvonen vesak at mlton.org
Wed Feb 28 04:37:19 PST 2007


Yet another test case.

----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/async/unstable/test/async.sml

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/async/unstable/test/async.sml
===================================================================
--- mltonlib/trunk/com/ssh/async/unstable/test/async.sml	2007-02-28 12:32:36 UTC (rev 5360)
+++ mltonlib/trunk/com/ssh/async/unstable/test/async.sml	2007-02-28 12:37:07 UTC (rev 5361)
@@ -128,5 +128,25 @@
                  ; when (take c, eq /> 3) ; runAll ()
                 end))
 
+      (title "Async")
+
+      (test (fn () => let
+                   val v = IVar.new ()
+                   val c = SkipCh.new ()
+                   val l = ref []
+                   fun lp () =
+                       any [on (SkipCh.take c, lp o push l),
+                            on (IVar.read v, push l)]
+                in
+                   lp ()
+                 ; runAll ()
+                 ; SkipCh.send c 1 ; runAll ()
+                 ; SkipCh.send c 2
+                 ; SkipCh.send c 3
+                 ; SkipCh.send c 4 ; runAll ()
+                 ; IVar.fill v 5 ; runAll ()
+                 ; eql (!l, [5, 4, 2, 1])
+                end))
+
       $
 end




More information about the MLton-commit mailing list