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


-- | Template Haskell for test framework
--   
--   Automatically generates a Test list for HUnit, doctest and
--   QuickCheck2.
@package test-framework-th-prime
@version 0.0.9


-- | Template Haskell to generate defaultMain with a list of <a>Test</a>
--   from "doc_test", "case_&lt;somthing&gt;", and "prop_&lt;somthing&gt;".
--   
--   An example of source code (Data/MySet.hs):
--   
--   <pre>
--   {-| Creating a set from a list. O(N log N)
--   
--   &gt;&gt;&gt; empty == fromList []
--   True
--   &gt;&gt;&gt; singleton 'a' == fromList ['a']
--   True
--   &gt;&gt;&gt; fromList [5,3,5] == fromList [5,3]
--   True
--   -}
--   
--   fromList :: Ord a =&gt; [a] -&gt; RBTree a
--   fromList = foldl' (flip insert) empty
--   </pre>
--   
--   An example of test code in the src directory (test/Test.hs):
--   
--   <pre>
--   {-# LANGUAGE TemplateHaskell #-}
--   module Main where
--   
--   import Test.Framework.TH.Prime
--   import Test.Framework.Providers.DocTest
--   import Test.Framework.Providers.HUnit
--   import Test.Framework.Providers.QuickCheck2
--   import Test.QuickCheck2
--   import Test.HUnit
--   
--   import Data.MySet
--   
--   main :: IO ()
--   main = $(defaultMainGenerator)
--   
--   doc_test :: DocTests
--   doc_test = docTest ["../Data/MySet.hs"] ["-i.."]
--   
--   prop_toList :: [Int] -&gt; Bool
--   prop_toList xs = ordered ys
--     where
--       ys = toList . fromList $ xs
--       ordered (x:y:xys) = x &lt;= y &amp;&amp; ordered (y:xys)
--       ordered _         = True
--   
--   case_ticket4242 :: Assertion
--   case_ticket4242 = (valid $ deleteMin $ deleteMin $ fromList [0,2,5,1,6,4,8,9,7,11,10,3]) @?= True
--   </pre>
--   
--   And run:
--   
--   <pre>
--   test% runghc -i.. Test.hs
--   </pre>
--   
--   "defaultMainGenerator" generates the following:
--   
--   <pre>
--   main = do
--       TestGroup _ doctests &lt;- docTest ["../Data/MySet.hs"] ["-i.."]
--       defaultMain [
--           testGroup "Doc tests" doctests
--         , testGroup "Unit tests" [
--                testCase "case_ticket4242" case_ticket4242
--              ]
--         , testGroup "Property tests" [
--                testProperty "prop_toList" prop_toList
--              ]
--         ]
--   </pre>
--   
--   Note: examples in haddock document is only used as unit tests at this
--   moment. I hope that properties of QuickCheck2 can also be specified in
--   haddock document in the future. I guess it's Haskell way of Behavior
--   Driven Development.
module Test.Framework.TH.Prime

-- | Generating defaultMain with a list of <a>Test</a> from "doc_test",
--   "case_&lt;somthing&gt;", and "prop_&lt;somthing&gt;".
defaultMainGenerator :: ExpQ

-- | Type for "doc_test".
type DocTests = IO Test
