packages feed

tasty-hedgehog 1.3.1.0 → 1.4.0.0

raw patch · 3 files changed

+23/−15 lines, 3 filesdep ~hedgehogPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hedgehog

API changes (from Hackage documentation)

- Test.Tasty.Hedgehog: HedgehogReplay :: Maybe (Size, Seed) -> HedgehogReplay
+ Test.Tasty.Hedgehog: HedgehogReplay :: Maybe (Skip, Seed) -> HedgehogReplay

Files

changelog.md view
@@ -1,5 +1,9 @@ # Revision history for tasty-hedgehog +## 1.4.0.0 -- 2022-10-12++* Support `hedgehog-1.2`. This is a breaking change due to `hedgehog`'s [new mechanism for skipping to a particular test and shrink result](https://github.com/hedgehogqa/haskell-hedgehog/pull/454). The `--hedgehog-replay` option now expects a `Skip` value and a `Seed`, for example: `stack test --test-arguments='--pattern "$NF ~ /badReverse involutive fails/" --hedgehog-replay "3:b2 Seed 10332913068362713902 1302058653756691475"'` ([#63](https://github.com/qfpl/tasty-hedgehog/pull/63))+ ## 1.3.1.0 -- 2022-10-03  * The instructions for reproducing test failures are now more clearly distinguished from `hedgehog`'s own instructions and include a pattern in the example to limit which tests are re-run. ([#62](https://github.com/qfpl/tasty-hedgehog/pull/62))
src/Test/Tasty/Hedgehog.hs view
@@ -73,15 +73,15 @@     mkTestTree (propName, prop) = testProperty (unPropertyName propName) prop  -- | The replay token to use for replaying a previous test run-newtype HedgehogReplay = HedgehogReplay (Maybe (Size, Seed))+newtype HedgehogReplay = HedgehogReplay (Maybe (Skip, Seed))   deriving (Typeable)  instance IsOption HedgehogReplay where   defaultValue = HedgehogReplay Nothing   parseValue v = HedgehogReplay . Just <$> replay-    -- Reads a replay token in the form "{size} {seed}"-    where replay = (,) <$> safeRead (unwords size) <*> safeRead (unwords seed)-          (size, seed) = splitAt 2 $ words v+    -- Reads a replay token in the form "{skip} {seed}"+    where replay = (,) <$> skipDecompress (unwords skip) <*> safeRead (unwords seed)+          (skip, seed) = splitAt 1 $ words v   optionName = return "hedgehog-replay"   optionHelp = return "Replay token to use for replaying a previous test run" @@ -147,7 +147,10 @@ reportToProgress :: PropertyConfig                  -> Report Progress                  -> T.Progress-reportToProgress config (Report testsDone _ _ status) =+reportToProgress config Report{+    reportTests = testsDone,+    reportStatus = status+  } =   let     TestLimit testLimit = propertyTestLimit config     ShrinkLimit shrinkLimit = propertyShrinkLimit config@@ -171,15 +174,17 @@   pure $ case reportStatus report of     Failed fr ->       let-        size = failureSize fr-        seed = failureSeed fr+        count = reportTests report+        seed = reportSeed report         replayStr =           if showReplay           then             "\nUse '--pattern \"$NF ~ /" ++             testName ++             "/\" --hedgehog-replay \"" ++-            show size ++ " " ++ show seed +++            skipCompress (SkipToShrink count $ failureShrinkPath fr) +++            " " +++            show seed ++             "\"' to reproduce from the command-line."           else ""       in@@ -211,13 +216,12 @@           (fromMaybe (propertyShrinkLimit pConfig) mShrinks)           (fromMaybe (propertyShrinkRetries pConfig) mRetries)           (NoConfidenceTermination $ fromMaybe (propertyTestLimit pConfig) mTests)+          (maybe Nothing (Just . fst) replay)      randSeed <- Seed.random-    let-      size = maybe 0 fst replay-      seed = maybe randSeed snd replay+    let seed = maybe randSeed snd replay -    report <- checkReport config size seed pTest (yieldProgress . reportToProgress config)+    report <- checkReport config 0 seed pTest (yieldProgress . reportToProgress config)      let       resultFn = if reportStatus report == OK
tasty-hedgehog.cabal view
@@ -1,5 +1,5 @@ name:                tasty-hedgehog-version:             1.3.1.0+version:             1.4.0.0 license:             BSD3 license-file:        LICENCE author:              Dave Laing@@ -24,7 +24,7 @@   build-depends:       base >= 4.8 && <4.18                      , tagged >= 0.8 && < 0.9                      , tasty >= 0.11 && < 1.5-                     , hedgehog >= 1.0.2 && < 1.1.3+                     , hedgehog >= 1.2 && < 1.3   hs-source-dirs:      src   ghc-options:         -Wall   default-language:    Haskell2010@@ -36,7 +36,7 @@   build-depends:       base >= 4.8 && <4.18                      , tasty >= 0.11 && < 1.5                      , tasty-expected-failure >= 0.11 && < 0.13-                     , hedgehog >= 1.0.2 && < 1.1.3+                     , hedgehog >= 1.2 && < 1.3                      , tasty-hedgehog   ghc-options:         -Wall   default-language:    Haskell2010