hedgehog-classes 0.2.4 → 0.2.4.1
raw patch · 5 files changed
+32/−21 lines, 5 filesdep ~basedep ~pretty-showPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, pretty-show
API changes (from Hackage documentation)
Files
- CHANGELOG.md +7/−0
- README.md +4/−14
- hedgehog-classes.cabal +5/−5
- src/Hedgehog/Classes/Common/Laws.hs +8/−1
- src/Hedgehog/Classes/Common/PP.hs +8/−1
CHANGELOG.md view
@@ -3,6 +3,13 @@ `hedgehog-classes` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +0.2.4.1+=======+* Fix error introduced by change of hedgehog's+ internal API between hedgehog-1.0.1 and+ hedgehog-1.0.2.+* Re-add GHC 8.8.1 to cabal's tested-with field.+ 0.2.4 ===== * Semirings upper bound increased to 0.6. [0.2, 0.5) -> [0.2, 0.6)
README.md view
@@ -72,23 +72,11 @@  -## Differences from similar libraries-There are a number of libraries that have similar goals to `hedgehog-classes`, and I will discuss only those that wrap `hedgehog`, not `QuickCheck`.+## Similar libraries+There are a number of libraries that have similar goals to `hedgehog-classes`: - [hedgehog-checkers](https://github.com/bitemyapp/hedgehog-checkers):- - Incomplete- - Not actively developed- - Less typeclasses- - Hasn't been uploaded to hackage, even with a sufficient starting-point API- - API is slightly more complex- - Does not make an effort to provide custom error messages- - Currently the only thing `hedgehog-checkers` can do that this library cannot- is test properties of higher-kinded typeclass laws where the construction of- the type requires constraints on its type arguments (e.g. `Ord` for something- like `Data.Set.Set`)- - [hedgehog-laws](https://github.com/qfpl/hedgehog-laws):- - All of the things that apply to `hedgehog-checkers`, but even more incomplete. ## Supported Typeclasses @@ -121,6 +109,8 @@ - `aeson` - ToJSON - ToJSON/FromJSON+ - `comonad`+ - Comonad - `semirings` - Semiring - Ring
hedgehog-classes.cabal view
@@ -2,7 +2,7 @@ name: hedgehog-classes version:- 0.2.4+ 0.2.4.1 synopsis: Hedgehog will eat your typeclass bugs description:@@ -16,9 +16,9 @@ . This library is directly inspired by `quickcheck-classes`. homepage:- https://github.com/chessai/hedgehog-classes+ https://github.com/hedgehogqa/haskell-hedgehog-classes bug-reports:- https://github.com/chessai/hedgehog-classes/issues+ https://github.com/hedgehogqa/haskell-hedgehog-classes/issues license: BSD-3-Clause license-file:@@ -36,13 +36,13 @@ extra-doc-files: README.md , CHANGELOG.md-tested-with: GHC == 8.6.5+tested-with: GHC == 8.6.5, GHC == 8.8.1 source-repository head type: git location:- https://github.com/chessai/hedgehog-classes.git+ https://github.com/hedgehogqa/haskell-hedgehog-classes.git flag aeson description:
src/Hedgehog/Classes/Common/Laws.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-}@@ -29,6 +30,7 @@ import Data.Monoid (All(..), Ap(..)) import Hedgehog (Gen) import Hedgehog.Classes.Common.Property (Context(..))+import Hedgehog.Internal.Config (UseColor(..)) import Hedgehog.Internal.Property (Property(..)) import Hedgehog.Internal.Region (Region) import Hedgehog.Internal.Report (Report, Result(..), Progress(..), renderProgress, reportStatus)@@ -275,7 +277,12 @@ checkRegion region prop = liftIO $ do seed <- liftIO Seed.random result <- checkReport (propertyConfig prop) 0 seed (propertyTest prop) $ \progress -> do- ppprogress <- renderProgress Nothing Nothing progress+#if MIN_VERSION_hedgehog(1,0,2)+ let u = EnableColor+#else+ let u = Just EnableColor+#endif+ ppprogress <- renderProgress u Nothing progress case reportStatus progress of Running -> Region.setRegion region ppprogress Shrinking _ -> Region.openRegion region ppprogress
src/Hedgehog/Classes/Common/PP.hs view
@@ -19,11 +19,18 @@ import Hedgehog.Internal.Report hiding (ppResult, renderResult) import Text.PrettyPrint.Annotated.WL (Doc) import qualified Hedgehog.Internal.Report as R+import Hedgehog.Internal.Config (UseColor(..)) renderResult :: MonadIO m => Report Result -> m String-renderResult x = renderDoc Nothing =<< ppResult x+renderResult x = renderDoc u =<< ppResult x+ where+#if MIN_VERSION_hedgehog(1,0,2)+ u = EnableColor+#else+ u = Just EnableColor+#endif ppResult :: MonadIO m => Report Result