packages feed

tasty-quickcheck 0.10 → 0.10.1

raw patch · 3 files changed

+26/−7 lines, 3 filesdep ~QuickCheck

Dependency ranges changed: QuickCheck

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ Changes ======= +Version 0.10.1+--------------++* Add a --quickcheck-shrinks flag+ Version 0.10 ------------ 
Test/Tasty/QuickCheck.hs view
@@ -95,6 +95,10 @@ newtype QuickCheckVerbose = QuickCheckVerbose Bool   deriving (Typeable) +-- | Number of shrinks allowed before QuickCheck will fail a test.+newtype QuickCheckMaxShrinks = QuickCheckMaxShrinks Int+  deriving (Num, Ord, Eq, Real, Enum, Integral, Typeable)+ instance IsOption QuickCheckTests where   defaultValue = 100   parseValue = fmap QuickCheckTests . safeRead@@ -141,6 +145,13 @@   optionHelp = return "Show the generated test cases"   optionCLParser = mkFlagCLParser mempty (QuickCheckVerbose True) +instance IsOption QuickCheckMaxShrinks where+  defaultValue = QuickCheckMaxShrinks (QC.maxShrinks QC.stdArgs)+  parseValue = fmap QuickCheckMaxShrinks . safeRead+  optionName = return "quickcheck-shrinks"+  optionHelp = return "Number of shrinks allowed before QuickCheck will fail a test"+  optionCLParser = mkOptionCLParser $ metavar "NUMBER"+ -- | Convert tasty options into QuickCheck options. -- -- This is a low-level function that was originally added for tasty-hspec@@ -159,15 +170,17 @@         , QC.maxSize         = maxSize         , QC.replay          = Just (mkQCGen replaySeed, 0)         , QC.maxDiscardRatio = maxRatio+        , QC.maxShrinks      = maxShrinks         }    return (replaySeed, args)    where-    QuickCheckTests    nTests   = lookupOption opts-    QuickCheckReplay   mReplay  = lookupOption opts-    QuickCheckMaxSize  maxSize  = lookupOption opts-    QuickCheckMaxRatio maxRatio = lookupOption opts+    QuickCheckTests      nTests     = lookupOption opts+    QuickCheckReplay     mReplay    = lookupOption opts+    QuickCheckMaxSize    maxSize    = lookupOption opts+    QuickCheckMaxRatio   maxRatio   = lookupOption opts+    QuickCheckMaxShrinks maxShrinks = lookupOption opts  instance IsTest QC where   testOptions = return@@ -177,6 +190,7 @@     , Option (Proxy :: Proxy QuickCheckMaxSize)     , Option (Proxy :: Proxy QuickCheckMaxRatio)     , Option (Proxy :: Proxy QuickCheckVerbose)+    , Option (Proxy :: Proxy QuickCheckMaxShrinks)     ]    run opts (QC prop) _yieldProgress = do
tasty-quickcheck.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                tasty-quickcheck-version:             0.10+version:             0.10.1 synopsis:            QuickCheck support for the Tasty test framework. description:         QuickCheck support for the Tasty test framework. license:             MIT@@ -26,7 +26,7 @@   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 >= 1.0.1, random, QuickCheck >= 2.7,                        optparse-applicative    -- hs-source-dirs:@@ -46,7 +46,7 @@     test.hs   build-depends:       base >= 4 && < 5-    , tasty >= 1.0.1+    , tasty     , tasty-quickcheck     , tasty-hunit     , pcre-light