[MLton-commit] r5209

Vesa Karvonen vesak at mlton.org
Thu Feb 15 15:05:39 PST 2007


Test that failing putWith doesn't change observable state.

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

U   mltonlib/trunk/com/ssh/misc-util/unstable/ptr-cache-test.sml

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

Modified: mltonlib/trunk/com/ssh/misc-util/unstable/ptr-cache-test.sml
===================================================================
--- mltonlib/trunk/com/ssh/misc-util/unstable/ptr-cache-test.sml	2007-02-15 22:42:12 UTC (rev 5208)
+++ mltonlib/trunk/com/ssh/misc-util/unstable/ptr-cache-test.sml	2007-02-15 23:05:39 UTC (rev 5209)
@@ -6,7 +6,7 @@
 
 val () = let
    open Type UnitTest
-   val notFound = verifyFailsWith (fn PtrCache.NotFound => true | _ => false)
+   fun notFound ? = verifyFailsWith (fn PtrCache.NotFound => true | _ => false) ?
    fun eq (e, a) = verifyEq int {actual = a, expect = e}
 in
    unitTests
@@ -17,7 +17,10 @@
                    val c = new ()
                    val () = eq (0, size c)
                    val k5 = put c 5
-                   val () = eq (1, size c)
+                   val () = (eq (1, size c)
+                           ; notFound (fn () => putWith c (failing NotFound))
+                           ; eq (1, size c)
+                           ; eq (5, get c k5))
                    val k2 = put c 2
                    val () = (eq (2, size c)
                            ; eq (5, use c k5)




More information about the MLton-commit mailing list