[MLton-commit] r5989

Vesa Karvonen vesak at mlton.org
Sat Sep 1 16:20:18 PDT 2007


Test also with BinTree.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/generic/unstable/test/some.sml

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

Modified: mltonlib/trunk/com/ssh/generic/unstable/test/some.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/test/some.sml	2007-09-01 23:19:22 UTC (rev 5988)
+++ mltonlib/trunk/com/ssh/generic/unstable/test/some.sml	2007-09-01 23:20:17 UTC (rev 5989)
@@ -4,7 +4,7 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
-val () = let
+local
    open Generic UnitTest
 
    fun listEither pair sumIn sumOut a =
@@ -17,12 +17,23 @@
 
    fun listL ? = listEither id        id       id       ?
    fun listR ? = listEither Pair.swap Sum.swap Sum.swap ?
+
+   structure BinTree = MkBinTree (Generic)
 in
-   unitTests
-      (title "Generic.Some")
+   val () =
+       unitTests
+          (title "Generic.Some")
 
-      (* Test that generation terminates both ways. *)
-      (test (fn () => verifyTrue (some (listL int) = some (listR int))))
+          (* Test that generation terminates both ways. *)
+          (testEq (list int)
+                  (fn () =>
+                      {actual = some (listL int),
+                       expect = some (listR int)}))
 
-      $
+          (testEq (BinTree.t int)
+                  (fn () =>
+                      {actual = some (BinTree.t int),
+                       expect = BinTree.LF}))
+
+          $
 end




More information about the MLton-commit mailing list