From d86effe073d75a73e544a58b16371664b8fcaf73 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 4 Dec 2018 16:21:48 +0800 Subject: [PATCH 1/2] Migrade to patience 0.2 (#1) --- chell/Test/Chell.hs | 3 ++- chell/chell.cabal | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chell/Test/Chell.hs b/chell/Test/Chell.hs index 5a28259..d02e24a 100644 --- a/chell/Test/Chell.hs +++ b/chell/Test/Chell.hs @@ -123,7 +123,6 @@ import qualified Control.Exception import Control.Exception (Exception) import Control.Monad (ap, liftM) import Control.Monad.IO.Class (MonadIO, liftIO) -import qualified Data.Algorithm.Patience as Patience import qualified Data.ByteString.Char8 import qualified Data.ByteString.Lazy.Char8 import Data.Foldable (Foldable, foldMap) @@ -136,6 +135,8 @@ import qualified Data.Text.Lazy import qualified Language.Haskell.TH as TH +import qualified Patience + import Test.Chell.Main (defaultMain) import Test.Chell.Types diff --git a/chell/chell.cabal b/chell/chell.cabal index b2df441..126975c 100644 --- a/chell/chell.cabal +++ b/chell/chell.cabal @@ -69,7 +69,7 @@ library base >= 4.1 && < 5.0 , bytestring >= 0.9 , options >= 1.0 && < 2.0 - , patience >= 0.1 && < 0.2 + , patience >= 0.2 && < 0.3 , random >= 1.0 , template-haskell >= 2.3 , text From bab1bd78ff47da389e7f35153eb6ba93e4f5e685 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Mon, 21 Jan 2019 01:15:45 +0800 Subject: [PATCH 2/2] Fix compatibility with QuickCheck 2.12 --- chell-quickcheck/Test/Chell/QuickCheck.hs | 12 ++++++++++++ chell-quickcheck/chell-quickcheck.cabal | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/chell-quickcheck/Test/Chell/QuickCheck.hs b/chell-quickcheck/Test/Chell/QuickCheck.hs index 0ec25b0..aaf35fb 100644 --- a/chell-quickcheck/Test/Chell/QuickCheck.hs +++ b/chell-quickcheck/Test/Chell/QuickCheck.hs @@ -53,8 +53,16 @@ property name prop = Chell.test name $ \opts -> do , State.computeSize = computeSize (QuickCheck.maxSize args) (QuickCheck.maxSuccess args) , State.numSuccessTests = 0 , State.numDiscardedTests = 0 +#if MIN_VERSION_QuickCheck(2,12,0) + , State.classes = mempty + , State.tables = mempty + , State.requiredCoverage = mempty + , State.expected = True + , State.coverageConfidence = Nothing +#else , State.collected = [] , State.expectedFailure = False +#endif #if MIN_VERSION_QuickCheck(2,7,0) , State.randomSeed = QCRandom.mkQCGen seed @@ -77,12 +85,16 @@ property name prop = Chell.test name $ \opts -> do #endif } +#if MIN_VERSION_QuickCheck(2,12,0) + result <- Test.test state (QuickCheck.property prop) +#else #if MIN_VERSION_QuickCheck(2,7,0) let genProp = unProperty (QuickCheck.property prop) #else let genProp = QuickCheck.property prop #endif result <- Test.test state (Gen.unGen genProp) +#endif let output = Test.output result let notes = [("seed", show seed)] let failure = Chell.failure { Chell.failureMessage = output } diff --git a/chell-quickcheck/chell-quickcheck.cabal b/chell-quickcheck/chell-quickcheck.cabal index 5b5482c..673363e 100644 --- a/chell-quickcheck/chell-quickcheck.cabal +++ b/chell-quickcheck/chell-quickcheck.cabal @@ -27,7 +27,7 @@ library build-depends: base >= 4.0 && < 5.0 , chell >= 0.3 && < 0.5 - , QuickCheck >= 2.3 && < 2.11 + , QuickCheck >= 2.3 && < 2.13 , random exposed-modules: