Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions chell-quickcheck/Test/Chell/QuickCheck.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
module Test.Chell.QuickCheck (property) where

import Test.Chell qualified as Chell
Expand Down Expand Up @@ -30,7 +31,12 @@ property name prop = Chell.test name $ \opts -> Text.withNullTerminal $ \term ->
{ State.terminal = term,
State.maxSuccessTests = QuickCheck.maxSuccess args,
State.maxDiscardedRatio = QuickCheck.maxDiscardRatio args,
#if MIN_VERSION_QuickCheck(2,15,0)
State.replayStartSize = Nothing,
State.maxTestSize = QuickCheck.maxSize args,
#else
State.computeSize = computeSize (QuickCheck.maxSize args) (QuickCheck.maxSuccess args),
#endif
State.numSuccessTests = 0,
State.numDiscardedTests = 0,
State.classes = mempty,
Expand Down Expand Up @@ -59,6 +65,7 @@ property name prop = Chell.test name $ \opts -> Text.withNullTerminal $ \term ->
Test.GaveUp {} -> Chell.TestAborted notes output
Test.NoExpectedFailure {} -> Chell.TestFailed notes [failure]

#if !MIN_VERSION_QuickCheck(2,15,0)
-- copied from quickcheck-2.4.1.1/src/Test/QuickCheck/Test.hs
computeSize :: Int -> Int -> Int -> Int -> Int
computeSize maxSize maxSuccess n d
Expand All @@ -79,3 +86,4 @@ computeSize maxSize maxSuccess n d

roundTo :: Int -> Int -> Int
roundTo n m = (n `div` m) * m
#endif
2 changes: 1 addition & 1 deletion chell-quickcheck/chell-quickcheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ library
build-depends:
, base ^>= 4.16 || ^>= 4.17 || ^>= 4.18 || ^>= 4.19 || ^>= 4.20 || ^>= 4.21
, chell ^>= 0.5
, QuickCheck ^>= 2.14.2
, QuickCheck ^>= 2.14.2 || ^>= 2.15.0
, random ^>= 1.2.1 || ^>= 1.3.0

exposed-modules:
Expand Down