tasty-quickcheck 0.9.2 → 0.10
raw patch · 3 files changed
+27/−5 lines, 3 filesdep +optparse-applicativedep ~tasty
Dependencies added: optparse-applicative
Dependency ranges changed: tasty
Files
- CHANGELOG.md +8/−0
- Test/Tasty/QuickCheck.hs +15/−2
- tasty-quickcheck.cabal +4/−3
CHANGELOG.md view
@@ -1,6 +1,14 @@ Changes ======= +Version 0.10+------------++* Do not re-export irrelevant Template Haskell QuickCheck functions+* Make boolean options case-insensitive+* Make --quickcheck-show-replay a command-line flag rather than an option+ requiring an argument `True`+ Version 0.9.2 -------------
Test/Tasty/QuickCheck.hs view
@@ -36,12 +36,20 @@ , verboseCheckWithResult , verboseCheckResult , verbose+ -- Template Haskell functions+#if MIN_VERSION_QuickCheck(2,11,0)+ , allProperties+#endif+ , forAllProperties+ , quickCheckAll+ , verboseCheckAll ) import Data.Typeable import Data.List import Text.Printf import Test.QuickCheck.Random (mkQCGen)+import Options.Applicative (metavar) import System.Random (getStdRandom, randomR) #if !MIN_VERSION_base(4,8,0) import Control.Applicative@@ -92,6 +100,7 @@ parseValue = fmap QuickCheckTests . safeRead optionName = return "quickcheck-tests" optionHelp = return "Number of test cases for QuickCheck to generate"+ optionCLParser = mkOptionCLParser $ metavar "NUMBER" instance IsOption QuickCheckReplay where defaultValue = QuickCheckReplay Nothing@@ -99,12 +108,14 @@ parseValue v = QuickCheckReplay . Just <$> safeRead v optionName = return "quickcheck-replay" optionHelp = return "Random seed to use for replaying a previous test run (use same --quickcheck-max-size)"+ optionCLParser = mkOptionCLParser $ metavar "SEED" instance IsOption QuickCheckShowReplay where defaultValue = QuickCheckShowReplay False- parseValue = fmap QuickCheckShowReplay . safeRead+ parseValue = fmap QuickCheckShowReplay . safeReadBool optionName = return "quickcheck-show-replay" optionHelp = return "Show a replay token for replaying tests"+ optionCLParser = flagCLParser Nothing (QuickCheckShowReplay True) defaultMaxSize :: Int defaultMaxSize = QC.maxSize QC.stdArgs@@ -114,16 +125,18 @@ parseValue = fmap QuickCheckMaxSize . safeRead optionName = return "quickcheck-max-size" optionHelp = return "Size of the biggest test cases quickcheck generates"+ optionCLParser = mkOptionCLParser $ metavar "NUMBER" instance IsOption QuickCheckMaxRatio where defaultValue = fromIntegral $ QC.maxDiscardRatio QC.stdArgs parseValue = fmap QuickCheckMaxRatio . safeRead optionName = return "quickcheck-max-ratio" optionHelp = return "Maximum number of discared tests per successful test before giving up"+ optionCLParser = mkOptionCLParser $ metavar "NUMBER" instance IsOption QuickCheckVerbose where defaultValue = QuickCheckVerbose False- parseValue = fmap QuickCheckVerbose . safeRead+ parseValue = fmap QuickCheckVerbose . safeReadBool optionName = return "quickcheck-verbose" optionHelp = return "Show the generated test cases" optionCLParser = mkFlagCLParser mempty (QuickCheckVerbose True)
tasty-quickcheck.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: tasty-quickcheck-version: 0.9.2+version: 0.10 synopsis: QuickCheck support for the Tasty test framework. description: QuickCheck support for the Tasty test framework. license: MIT@@ -26,7 +26,8 @@ exposed-modules: Test.Tasty.QuickCheck -- other-modules: other-extensions: GeneralizedNewtypeDeriving, DeriveDataTypeable- build-depends: base == 4.*, tagged, tasty >= 0.10.1, random, QuickCheck >= 2.7+ build-depends: base == 4.*, tagged, tasty >= 0.10.1, random, QuickCheck >= 2.7,+ optparse-applicative -- hs-source-dirs: default-language: Haskell2010@@ -45,7 +46,7 @@ test.hs build-depends: base >= 4 && < 5- , tasty >= 0.11.1+ , tasty >= 1.0.1 , tasty-quickcheck , tasty-hunit , pcre-light