[MLton-commit] r6107

Vesa Karvonen vesak at mlton.org
Tue Oct 30 13:01:54 PST 2007


An additional example.

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

A   mltonlib/trunk/com/ssh/unit-test/unstable/example/innocent.sml
U   mltonlib/trunk/com/ssh/unit-test/unstable/example.mlb

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

Added: mltonlib/trunk/com/ssh/unit-test/unstable/example/innocent.sml
===================================================================
--- mltonlib/trunk/com/ssh/unit-test/unstable/example/innocent.sml	2007-10-30 11:51:23 UTC (rev 6106)
+++ mltonlib/trunk/com/ssh/unit-test/unstable/example/innocent.sml	2007-10-30 21:01:53 UTC (rev 6107)
@@ -0,0 +1,31 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+val () = let
+   open Generic UnitTest
+in
+   unitTests
+      (title "Reverse (incorrect)")
+
+      (testAll (sq (list int))
+               (fn (xs, ys) =>
+                   thatEq (list int)
+                          {expect = rev (xs @ ys),
+                           actual = rev xs @ rev ys}))
+
+      (* Read the above as:
+       *
+       *   "Test for all pairs of lists of integers xs and ys, that the
+       *    lists of integers expect and actual are equal, where the
+       *    expect list is the reverse of the concatenation of xs and ys
+       *    and the actual list is the concatenation of the reverse of xs
+       *    and the reverse of ys."
+       *
+       * (Of course, this property does not hold.)
+       *)
+
+      $
+end


Property changes on: mltonlib/trunk/com/ssh/unit-test/unstable/example/innocent.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: mltonlib/trunk/com/ssh/unit-test/unstable/example.mlb
===================================================================
--- mltonlib/trunk/com/ssh/unit-test/unstable/example.mlb	2007-10-30 11:51:23 UTC (rev 6106)
+++ mltonlib/trunk/com/ssh/unit-test/unstable/example.mlb	2007-10-30 21:01:53 UTC (rev 6107)
@@ -14,6 +14,7 @@
    detail/sorted-list.sml
 
    example/assoc-test.sml
+   example/innocent.sml
    example/qc-test.sml
 in
 end




More information about the MLton-commit mailing list