[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 14:54:53 UTC 2010


The following commit has been merged in the master branch:
commit 8b45ea6c1c0028e62d0ba3479e828690f0b5a113
Author: John Goerzen <jgoerzen at complete.org>
Date:   Thu Feb 3 00:18:01 2005 +0100

    Finished tests for AnyDBM
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.7--patch-191)

diff --git a/ChangeLog b/ChangeLog
index c31c466..e683610 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
 #
 
+2005-02-02 17:18:01 GMT	John Goerzen <jgoerzen at complete.org>	patch-191
+
+    Summary:
+      Finished tests for AnyDBM
+    Revision:
+      missingh--head--0.7--patch-191
+
+
+    modified files:
+     ChangeLog testsrc/AnyDBMtest.hs
+
+
 2005-02-02 17:05:24 GMT	John Goerzen <jgoerzen at complete.org>	patch-190
 
     Summary:
diff --git a/testsrc/AnyDBMtest.hs b/testsrc/AnyDBMtest.hs
index 6055f72..af23dd6 100644
--- a/testsrc/AnyDBMtest.hs
+++ b/testsrc/AnyDBMtest.hs
@@ -23,6 +23,7 @@ import MissingH.IO.HVFS
 import MissingH.IO.HVFS.InstanceHelpers
 import MissingH.AnyDBM
 import MissingH.AnyDBM.StringDBM
+import MissingH.AnyDBM.FiniteMapDBM
 import Data.HashTable
 import Data.List(sort)
 import Control.Exception(finally)
@@ -73,13 +74,36 @@ generic_test initfunc openfunc =
                                    deleteall h
         ]
 
+generic_persist_test initfunc openfunc =
+    let f = mf initfunc openfunc in
+        [
+         f "empty" deleteall 
+        ,f "weirdpop" $ \h -> insertListA h weirdl
+        ,f "weirdcheck" $ \h -> do weirdl @>=? (toListA h >>= return . sort)
+                                   deleteall h
+                                   insertA h "key" "value"
+        ,f "step3" $ \h -> do [("key", "value")] @>=? (toListA h >>= return . sort)
+                              insertA h "key" "v2"
+                              insertA h "z" "y"
+        ,f "step4" $ \h -> do [("key", "v2"), ("z", "y")] @>=?
+                                 (toListA h >>= return . sort)
+        ,f "cleanup" deleteall
+        ]
+
 test_hashtable = generic_test (return ())
                   (\_ -> ((new (==) hashString)::IO (HashTable String String)))
-test_stringdbm = generic_test (return SystemFS)
+
+test_finitemap = generic_test (return ())
+                  (\_ -> newFiniteMapDBM)
+test_stringdbm = generic_persist_test (return SystemFS)
+                   (\f -> openStringVDBM f "testsrc/tmp/StringDBM" ReadWriteMode)
+                 ++
+                 generic_test (return SystemFS)
                    (\f -> openStringVDBM f "testsrc/tmp/StringDBM" ReadWriteMode)
 
 tests = TestList [TestLabel "HashTable" (TestList test_hashtable),
-                  TestLabel "StringDBM" (TestList test_stringdbm)
+                  TestLabel "StringDBM" (TestList test_stringdbm),
+                  TestLabel "FiniteMap" (TestList test_finitemap)
                  ]
 
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list