]> code.delx.au - offlineimap/blobdiff - testsrc/TestInfrastructure.hs
Suppress the test counter
[offlineimap] / testsrc / TestInfrastructure.hs
index 0b05e0fcd3fcc3c5855fdfe1eb3d972aa0b5beb9..255a2328bef2e092dd76fa4f2d046ad1ef79b923 100644 (file)
@@ -25,6 +25,7 @@ import System.IO
 import Text.Printf
 import System.Random
 import Data.Word
+import Test.HUnit.Utils
 
 (@=?) :: (Eq a, Show a) => a -> a -> Result
 expected @=? actual = 
@@ -78,3 +79,11 @@ runVerbTestText (HU.PutText put us) t = do
          kind  = if null path' then p0 else p1
          path' = HU.showPath (HU.path ss)
 
+q :: Testable a => String -> a -> HU.Test
+q = qccheck (defaultConfig {configMaxTest = 250, configMaxFail = 10000,
+                            configEvery = \_ _ -> ""})
+    -- configEvery = testCount for displaying a running test counter
+    where testCountBase n = " (test " ++ show n ++ "/250)"
+          testCount n _ = testCountBase n ++ 
+                          replicate (length (testCountBase n)) '\b'
+