-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Test Utililty Pack for HUnit and QuickCheck
--   
--   Haskell Test Utility Pack for HUnit and QuickCheck testpack provides
--   utilities for both HUnit and QuickCheck. These include tools for
--   running QuickCheck properties as HUnit test cases, allowing you to
--   combine both approaches in a single program. It also includes tools
--   for more helpful displays of running progress in both HUnit and
--   QuickCheck, additional generators for other types for QuickCheck, and
--   shortcuts for quickly defining new test cases.
@package testpack
@version 2.1.1


-- | Provides Arbitrary instances for:
--   
--   <ul>
--   <li>Map.Map k v</li>
--   <li>Word8 (also a Random instance)</li>
--   </ul>
--   
--   Written by John Goerzen, jgoerzen@complete.org
module Test.QuickCheck.Instances
instance (CoArbitrary k, CoArbitrary v, Eq k, Ord k) => CoArbitrary (Map k v)
instance (Arbitrary k, Arbitrary v, Eq k, Ord k) => Arbitrary (Map k v)


-- | Utilities for HUnit unit testing.
--   
--   Written by John Goerzen, jgoerzen@complete.org
module Test.QuickCheck.Tools

-- | Compare two values. If same, the test passes. If different, the result
--   indicates what was expected and what was received as part of the
--   error.
(@=?) :: (Eq a, Show a) => a -> a -> Result

-- | Like <a>@=?</a>, but with args in a different order.
(@?=) :: (Eq a, Show a) => a -> a -> Result


-- | Utilities for HUnit unit testing.
--   
--   Written by John Goerzen, jgoerzen@complete.org
module Test.HUnit.Tools

-- | Asserts that a specific exception is raised by a given action.
assertRaises :: (Show a, Exception e, Show e, Eq e) => String -> e -> IO a -> IO ()
mapassertEqual :: (Show b, Eq b) => String -> (a -> b) -> [(a, b)] -> [Test]

-- | Like <tt>runTestText</tt>, but with more verbose output.
runVerbTestText :: PutText st -> Test -> IO (Counts, st)

-- | Run verbose tests. Example:
--   
--   <pre>
--   test1 = TestCase ("x" @=? "x")
--   
--   alltests = [TestLabel "test1" test1,
--               tl "TestNum" TestNum.allt,
--               tl "TestMap" TestMap.allt,
--               tl "TestTime" TestTime.allt]
--   
--   main = do runVerboseTests (TestList alltests)
--             return ()
--   </pre>
runVerboseTests :: Test -> IO (Counts, Int)

-- | qccheck turns the quickcheck test into an hunit test
qccheck :: Testable a => Args -> String -> a -> Test

-- | qctest is equivalent to 'qccheck stdArgs'
qctest :: Testable a => String -> a -> Test

-- | Convert QuickCheck tests to HUnit, with a configurable maximum test
--   count. Often used like this:
--   
--   <pre>
--   q :: QC.Testable a =&gt; String -&gt; a -&gt; HU.Test
--   q = qc2hu 250
--   
--   allt = [q "Int -&gt; Integer" prop_int_to_integer,
--           q "Integer -&gt; Int (safe bounds)" prop_integer_to_int_pass]
--   </pre>
qc2hu :: Testable a => Int -> String -> a -> Test

-- | Label the tests list. See example under <a>runVerboseTests</a>.
tl :: String -> [Test] -> Test
