[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:05:00 UTC 2010


The following commit has been merged in the master branch:
commit feb593f9558b1395796bd3bac8a7b88c98130cbf
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Dec 27 02:36:56 2005 +0100

    Added test for MissingH.Map based on tests for MissingH.FiniteMap

diff --git a/testsrc/FiniteMaptest.hs b/testsrc/Maptest.hs
similarity index 73%
copy from testsrc/FiniteMaptest.hs
copy to testsrc/Maptest.hs
index 55d3ba4..ebc690b 100644
--- a/testsrc/FiniteMaptest.hs
+++ b/testsrc/Maptest.hs
@@ -1,4 +1,4 @@
-{- arch-tag: FiniteMap tests main file
+{-
 Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
 
 This program is free software; you can redistribute it and/or modify
@@ -16,13 +16,13 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
-module FiniteMaptest(tests) where
+module Maptest(tests) where
 import Test.HUnit
-import MissingH.FiniteMap
-import Data.FiniteMap
+import MissingH.Map
+import Data.Map as M
 
-test_flipFM =
-    let f inp exp = TestCase $ (listToFM exp) @=? flipFM (listToFM inp) in
+test_flipM =
+    let f inp exp = TestCase $ (M.fromList exp) @=? flipM (M.fromList inp) in
         [
          f ([]::[(Int,Int)]) ([]::[(Int,[Int])])
         ,f [("a", "b")] [("b", ["a"])]
@@ -33,8 +33,8 @@ test_flipFM =
                          ("e", ["d"])]
         ]
 
-test_flippedLookupFM =
-    let f item inp exp = TestCase $ exp @=? flippedLookupFM (listToFM inp) item in
+test_flippedLookupM =
+    let f item inp exp = TestCase $ exp @=? flippedLookupM (M.fromList inp) item in
         [
          f 'a' ([]::[(Char, Char)]) []
         ,f 'a' [("Test1", 'a'), ("Test2", 'b')] ["Test1"]
@@ -42,6 +42,6 @@ test_flippedLookupFM =
         ,f 'a' [("Test1", 'a'), ("Test2", 'a')] ["Test2", "Test1"]
         ]
 
-tests = TestList [TestLabel "flipFM" (TestList test_flipFM),
-                  TestLabel "flippedLookupFM" (TestList test_flippedLookupFM)
+tests = TestList [TestLabel "flipM" (TestList test_flipM),
+                  TestLabel "flippedLookupM" (TestList test_flippedLookupM)
                  ]

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list