sandwich-hedgehog 0.1.1.0 → 0.1.2.0
raw patch · 4 files changed
+48/−13 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Test.Sandwich.Hedgehog: hedgehogSkip :: HedgehogParams -> Maybe Skip
+ Test.Sandwich.Hedgehog: modifySkip :: (HasHedgehogContext context, Monad m) => (Maybe Skip -> Maybe Skip) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()
Files
- ChangeLog.md +2/−1
- LICENSE +1/−1
- sandwich-hedgehog.cabal +5/−5
- src/Test/Sandwich/Hedgehog.hs +40/−6
ChangeLog.md view
@@ -1,7 +1,8 @@ # Changelog for sandwich-hedgehog -## Unreleased changes+## 0.1.2.0 +* Support propertySkip in hedgehog ## 0.1.1.0
LICENSE view
@@ -1,4 +1,4 @@-Copyright Tom McLaughlin (c) 2022+Copyright Tom McLaughlin (c) 2023 All rights reserved.
sandwich-hedgehog.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.35.1. -- -- see: https://github.com/sol/hpack name: sandwich-hedgehog-version: 0.1.1.0+version: 0.1.2.0 synopsis: Sandwich integration with Hedgehog description: Please see the <https://codedownio.github.io/sandwich/docs/extensions/sandwich-hedgehog documentation>. category: Testing@@ -13,7 +13,7 @@ bug-reports: https://github.com/codedownio/sandwich-hedgehog/issues author: Tom McLaughlin maintainer: tom@codedown.io-copyright: 2022 Tom McLaughlin+copyright: 2023 Tom McLaughlin license: BSD3 license-file: LICENSE build-type: Simple@@ -52,6 +52,7 @@ , text , time , wl-pprint-annotated+ default-language: Haskell2010 if !os(windows) build-depends: vty@@ -60,7 +61,6 @@ Test.Sandwich.Hedgehog.Render hs-source-dirs: unix-src- default-language: Haskell2010 test-suite sandwich-hedgehog-test type: exitcode-stdio-1.0@@ -91,7 +91,7 @@ , text , time , wl-pprint-annotated+ default-language: Haskell2010 if !os(windows) build-depends: vty- default-language: Haskell2010
src/Test/Sandwich/Hedgehog.hs view
@@ -26,6 +26,9 @@ , hedgehogShrinkLimit , hedgehogShrinkRetries , hedgehogTerminationCriteria+#if MIN_VERSION_hedgehog(1,2,0)+ , hedgehogSkip+#endif , hedgehogSize , hedgehogSeed @@ -42,6 +45,7 @@ , modifyShrinkLimit , modifyShrinkRetries , modifyTerminationCriteria+ , modifySkip , modifySize , modifySeed @@ -85,6 +89,10 @@ , hedgehogShrinkRetries :: Maybe ShrinkRetries -- | Control when the test runner should terminate. , hedgehogTerminationCriteria :: Maybe TerminationCriteria+ -- | Control where to start running a property's tests+#if MIN_VERSION_hedgehog(1,2,0)+ , hedgehogSkip :: Maybe Skip+#endif } deriving (Show) defaultHedgehogParams = HedgehogParams {@@ -94,6 +102,9 @@ , hedgehogShrinkLimit = Nothing , hedgehogShrinkRetries = Nothing , hedgehogTerminationCriteria = Nothing+#if MIN_VERSION_hedgehog(1,2,0)+ , hedgehogSkip = Nothing+#endif } newtype HedgehogContext = HedgehogContext HedgehogParams@@ -147,6 +158,11 @@ , propertyShrinkLimit = fromMaybe (propertyShrinkLimit defaultConfig) hedgehogShrinkLimit , propertyShrinkRetries = fromMaybe (propertyShrinkRetries defaultConfig) hedgehogShrinkRetries , propertyTerminationCriteria = fromMaybe (propertyTerminationCriteria defaultConfig) hedgehogTerminationCriteria++#if MIN_VERSION_hedgehog(1,2,0)+ , propertySkip = hedgehogSkip <|> propertySkip defaultConfig+#endif+ } let size = fromMaybe 0 hedgehogSize@@ -188,28 +204,46 @@ type HedgehogContextLabel context = LabelValue "hedgehogContext" HedgehogContext :> context -- | Modify the 'Seed' for the given spec.-modifySeed :: (HasHedgehogContext context, Monad m) => (Maybe Seed -> Maybe Seed) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifySeed :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe Seed -> Maybe Seed) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m () modifySeed f = modifyArgs $ \args -> args { hedgehogSeed = f (hedgehogSeed args) } -- | Modify the 'Size' for the given spec.-modifySize :: (HasHedgehogContext context, Monad m) => (Maybe Size -> Maybe Size) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifySize :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe Size -> Maybe Size) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m () modifySize f = modifyArgs $ \args -> args { hedgehogSize = f (hedgehogSize args) } -- | Modify the 'DiscardLimit' for the given spec.-modifyDiscardLimit :: (HasHedgehogContext context, Monad m) => (Maybe DiscardLimit -> Maybe DiscardLimit) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifyDiscardLimit :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe DiscardLimit -> Maybe DiscardLimit) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m () modifyDiscardLimit f = modifyArgs $ \args -> args { hedgehogDiscardLimit = f (hedgehogDiscardLimit args) } -- | Modify the 'ShrinkLimit' for the given spec.-modifyShrinkLimit :: (HasHedgehogContext context, Monad m) => (Maybe ShrinkLimit -> Maybe ShrinkLimit) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifyShrinkLimit :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe ShrinkLimit -> Maybe ShrinkLimit) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m () modifyShrinkLimit f = modifyArgs $ \args -> args { hedgehogShrinkLimit = f (hedgehogShrinkLimit args) } -- | Modify the 'ShrinkRetries' for the given spec.-modifyShrinkRetries :: (HasHedgehogContext context, Monad m) => (Maybe ShrinkRetries -> Maybe ShrinkRetries) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifyShrinkRetries :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe ShrinkRetries -> Maybe ShrinkRetries) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m () modifyShrinkRetries f = modifyArgs $ \args -> args { hedgehogShrinkRetries = f (hedgehogShrinkRetries args) } -- | Modify the 'TerminationCriteria' for the given spec.-modifyTerminationCriteria :: (HasHedgehogContext context, Monad m) => (Maybe TerminationCriteria -> Maybe TerminationCriteria) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifyTerminationCriteria :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe TerminationCriteria -> Maybe TerminationCriteria) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m () modifyTerminationCriteria f = modifyArgs $ \args -> args { hedgehogTerminationCriteria = f (hedgehogTerminationCriteria args) }++-- | Modify the 'Skip' for the given spec.+modifySkip :: (+ HasHedgehogContext context, Monad m+ ) => (Maybe Skip -> Maybe Skip) -> SpecFree (HedgehogContextLabel context) m () -> SpecFree context m ()+modifySkip f = modifyArgs $ \args -> args { hedgehogSkip = f (hedgehogSkip args) } addCommandLineOptions :: CommandLineOptions a -> HedgehogParams -> HedgehogParams addCommandLineOptions (CommandLineOptions {optHedgehogOptions=(CommandLineHedgehogOptions {..})}) baseHedgehogParams@(HedgehogParams {..}) = baseHedgehogParams {