tasty-quickcheck 0.8.1 → 0.8.2
raw patch · 4 files changed
+61/−10 lines, 4 files
Files
- CHANGELOG +0/−1
- CHANGELOG.md +38/−0
- Test/Tasty/QuickCheck.hs +17/−5
- tasty-quickcheck.cabal +6/−4
− CHANGELOG
@@ -1,1 +0,0 @@-See https://github.com/feuerbach/tasty/blob/master/CHANGES.md
+ CHANGELOG.md view
@@ -0,0 +1,38 @@+Changes+=======++Version 0.8.2+-------------++* Allow suppressing the --quickcheck-replay hint+* Split the changelog out of the main tasty changelog++Version 0.8.1+-------------++Re-export `Gen` from `Test.Tasty.QuickCheck`++Version 0.8.0.3+---------------++Upgrade to QuickCheck 2.7++Version 0.8+-----------++Update to tasty-0.8++Version 0.3.1+-------------++Use the original QuickCheck's output format++Version 0.3+-----------++Add options for maximum size and maximum ratio; support replay.++Version 0.2+-----------++Re-export useful bits of `Test.QuickCheck` from `Test.Tasty.QuickCheck`
Test/Tasty/QuickCheck.hs view
@@ -48,6 +48,10 @@ newtype QuickCheckReplay = QuickCheckReplay (Maybe (QCGen, Int)) deriving (Typeable) +-- | If a test case fails unexpectedly, show the replay token+newtype QuickCheckShowReplay = QuickCheckShowReplay Bool+ deriving (Typeable)+ -- | Size of the biggest test cases newtype QuickCheckMaxSize = QuickCheckMaxSize Int deriving (Num, Ord, Eq, Real, Enum, Integral, Typeable)@@ -71,6 +75,12 @@ optionName = return "quickcheck-replay" optionHelp = return "Replay token to use for replaying a previous test run" +instance IsOption QuickCheckShowReplay where+ defaultValue = QuickCheckShowReplay True+ parseValue = fmap QuickCheckShowReplay . safeRead+ optionName = return "quickcheck-show-replay"+ optionHelp = return "Show a replay token for replaying tests"+ instance IsOption QuickCheckMaxSize where defaultValue = fromIntegral $ QC.maxSize QC.stdArgs parseValue = fmap QuickCheckMaxSize . safeRead@@ -87,23 +97,25 @@ testOptions = return [ Option (Proxy :: Proxy QuickCheckTests) , Option (Proxy :: Proxy QuickCheckReplay)+ , Option (Proxy :: Proxy QuickCheckShowReplay) , Option (Proxy :: Proxy QuickCheckMaxSize) , Option (Proxy :: Proxy QuickCheckMaxRatio) ] run opts (QC prop) yieldProgress = do let- QuickCheckTests nTests = lookupOption opts- QuickCheckReplay replay = lookupOption opts- QuickCheckMaxSize maxSize = lookupOption opts- QuickCheckMaxRatio maxRatio = lookupOption opts+ QuickCheckTests nTests = lookupOption opts+ QuickCheckReplay replay = lookupOption opts+ QuickCheckShowReplay showReplay = lookupOption opts+ QuickCheckMaxSize maxSize = lookupOption opts+ QuickCheckMaxRatio maxRatio = lookupOption opts args = QC.stdArgs { QC.chatty = False, QC.maxSuccess = nTests, QC.maxSize = maxSize, QC.replay = replay, QC.maxDiscardRatio = maxRatio} -- TODO yield progress r <- QC.quickCheckWithResult args prop return $ (if successful r then testPassed else testFailed)- (if unexpected r+ (if unexpected r && showReplay then QC.output r ++ reproduceMsg r else QC.output r )
tasty-quickcheck.cabal view
@@ -2,17 +2,19 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: tasty-quickcheck-version: 0.8.1+version: 0.8.2 synopsis: QuickCheck support for the Tasty test framework. description: QuickCheck support for the Tasty test framework. license: MIT license-file: LICENSE-author: Roman Cheplyaka-maintainer: roma@ro-che.info+author: Roman Cheplyaka <roma@ro-che.info>+maintainer: Roman Cheplyaka <roma@ro-che.info> -- copyright: +homepage: http://documentup.com/feuerbach/tasty+bug-reports: https://github.com/feuerbach/tasty/issues category: Testing build-type: Simple-extra-source-files: CHANGELOG+extra-source-files: CHANGELOG.md cabal-version: >=1.10 Source-repository head