]> code.delx.au - offlineimap/commitdiff
Tests now run
authorJohn Goerzen <jgoerzen@complete.org>
Wed, 28 May 2008 16:17:48 +0000 (11:17 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Wed, 28 May 2008 16:17:48 +0000 (11:17 -0500)
OfflineIMAP.cabal
testsrc/runtests.hs

index 5ee0f000f12415dfd4f8c62502265c8e00d2681d..92ac69d560577714f7661af156754829e708fca7 100644 (file)
@@ -69,7 +69,9 @@ Executable offlineimap
 
 Executable runtests
   Build-Depends: HUnit
-  Main-Is: testsrc/runtests.hs
+  Main-Is: runtests.hs
+  Hs-Source-Dirs: src, testsrc
   GHC-Options: -O2
+  Build-Depends: QuickCheck
   Extensions: ExistentialQuantification, OverlappingInstances,
       UndecidableInstances
index ba63b8b248252a74c6110a084d8d1a06c6c5648b..7eb124aec2564d6cceb022a66e3e335d38f212ce 100644 (file)
@@ -16,11 +16,28 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
-module Main where 
+module Main where
+import Test.QuickCheck
+import Test.QuickCheck.Batch
+import qualified Test.HUnit as HU
+import Test.HUnit.Utils
+import qualified Data.Map as Map
 
-import Test.HUnit
--- import Tests
+import Data.Syncable
 
--- main = runTestTT tests
-main = putStrLn "fake"
+prop_empty =
+    syncThem emptymap emptymap emptymap == ([], [], [])
 
+keysToMap :: Ord k => [k] -> Map.Map k ()
+keysToMap = foldl (\map k -> Map.insert k () map) Map.empty
+
+emptymap :: Map.Map Integer ()
+emptymap = Map.empty
+
+allt = [qctest "Empty" prop_empty]
+
+testh = HU.runTestTT $ HU.TestList allt
+         
+main = 
+    do testh
+       return ()