X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FTestSuite.hs;h=fa39ef3de373a3a921fef21a425111d55509db1e;hb=a8c2d85d8611f7f56eaa0c3406ec423d68f81f96;hp=d7cc5fffe7b60141d3d17090820d4bb50336dfb4;hpb=9200fe5fcab505e5a331514a6ee687c6f78011b1;p=hath.git diff --git a/test/TestSuite.hs b/test/TestSuite.hs index d7cc5ff..fa39ef3 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -1,32 +1,25 @@ -{-# LANGUAGE NoMonomorphismRestriction #-} -import Test.HUnit -import Test.QuickCheck (Args(..), quickCheckWith, stdArgs) +import Test.Tasty( TestTree, defaultMain, localOption, testGroup ) +import Test.Tasty.QuickCheck( + QuickCheckTests( QuickCheckTests ), + QuickCheckMaxRatio( QuickCheckMaxRatio )) +import Cidr( cidr_properties, cidr_tests ) +import IPv4Address( ipv4address_properties, ipv4address_tests ) +import Octet( octet_properties, octet_tests ) -import Cidr (cidr_tests, - prop_all_cidrs_contain_themselves, - prop_contains_proper_intransitive) - -import IPv4Address (ipv4address_tests) -import Octet (octet_tests) - --- The list of HUnit tests. -test_suite = TestList (concat [cidr_tests, - ipv4address_tests, - octet_tests]) +tests :: TestTree +tests = testGroup "All Tests" [ + cidr_properties, + cidr_tests, + ipv4address_properties, + ipv4address_tests, + octet_properties, + octet_tests ] +-- | Warning: the QuickCheckMaxRatio option is not a ratio. It's +-- currently set to \"100%\", so that the test suite passes even if +-- we have to throw out all of our random test cases. main :: IO () -main = do - putStrLn "HUnit" - putStrLn "-----" - runTestTT test_suite - - putStrLn "" - - putStrLn "QuickCheck" - putStrLn "----------" - qc prop_all_cidrs_contain_themselves - qc prop_contains_proper_intransitive - where - args :: Args - args = stdArgs { maxDiscard = 5000 } - qc = quickCheckWith args +main = + defaultMain $ + localOption (QuickCheckTests 5000) $ + localOption (QuickCheckMaxRatio 5000) tests