]> code.delx.au - offlineimap/blobdiff - testsrc/runtests.hs
Added quoted test
[offlineimap] / testsrc / runtests.hs
index 0c8a1521bd5e37669a493018eabd84134036e652..c0f27bb0951b2155b554040b3e27d4fda09f86b3 100644 (file)
@@ -21,33 +21,27 @@ import Test.QuickCheck
 import Test.QuickCheck.Batch
 import qualified Test.HUnit as HU
 import Test.HUnit.Utils
-import qualified Data.Map as Map
 import Data.List
 import System.IO(stderr)
+import Data.Word
 
-import Data.Syncable
 import TestInfrastructure
 
-prop_empty :: Bool
-prop_empty =
-    syncThem emptymap emptymap emptymap == ([], [], []) -- ([DeleteItem 5], [], [])
-
-prop_delAllFromChild :: SyncCollection Int -> Result
-prop_delAllFromChild inp =
-    let (resMaster, resChild, resState) = syncThem emptymap inp inp
-        expectedResChild = sort . map DeleteItem . Map.keys $ inp
-        in ([], expectedResChild, expectedResChild) @=? 
-           (resMaster, sort resChild, sort resState)
-           
-prop_addFromMaster :: SyncCollection Int -> Result
-prop_addFromMaster inp =
-    let (resMaster, resChild, resState) = syncThem inp emptymap emptymap
-        expectedResChild = sort . map CopyItem . Map.keys $ inp
-        in ([], expectedResChild, expectedResChild) @=? 
-           (resMaster, sort resChild, sort resState)
-
-allt = [qctest "Empty" prop_empty,
-        qctest "Del all from child" prop_delAllFromChild]
+import qualified TestSyncable
+import qualified TestConnection
+import qualified TestParser
+import qualified TestParserPrim
+
+q :: Testable a => String -> a -> HU.Test
+q = qccheck (defaultConfig {configMaxTest = 250})
+
+tl msg t = HU.TestLabel msg $ HU.TestList t
+
+allt = [tl "TestSyncable" TestSyncable.allt,
+        tl "TestConnection" TestConnection.allt,
+        tl "TestParserPrim" TestParserPrim.allt,
+        tl "TestParser" TestParser.allt
+       ]
 
 testh = HU.runTestTT $ HU.TestList allt
 testv = runVerbTestText (HU.putTextToHandle stderr True) $ HU.TestList allt