tasty-hedgehog 1.1.0.0 → 1.2.0.0
raw patch · 4 files changed
+46/−13 lines, 4 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Test.Tasty.Hedgehog: testPropertyNamed :: TestName -> PropertyName -> Property -> TestTree
Files
- changelog.md +5/−1
- src/Test/Tasty/Hedgehog.hs +26/−6
- tasty-hedgehog.cabal +5/−5
- test/Main.hs +10/−1
changelog.md view
@@ -1,5 +1,9 @@ # Revision history for tasty-hedgehog +## 1.2.0.0 -- 2022-03-07++* Add `testPropertyNamed` function and deprecate `testProperty`.+ ## 1.1.0.0 -- 2021-04-03 * Add fromGroup function@@ -25,7 +29,7 @@ ## 0.2.0.0 -- 2018-03-13 * Removes the verbosity option, which was unsupported-* Fixes a bug in configuration option handling, which +* Fixes a bug in configuration option handling, which was overwriting use configuration with the defaults. ## 0.1.0.2 -- 2018-01-22
src/Test/Tasty/Hedgehog.hs view
@@ -4,14 +4,15 @@ -- -- @ -- testGroup "tasty-hedgehog tests" [--- testProperty "reverse involutive" prop_reverse_involutive--- , testProperty "sort idempotent" prop_sort_idempotent+-- testPropertyNamed "reverse involutive" "prop_reverse_involutive" prop_reverse_involutive+-- , testPropertyNamed "sort idempotent" "prop_sort_idempotent" prop_sort_idempotent -- ] -- @ -- {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Test.Tasty.Hedgehog ( testProperty+ , testPropertyNamed , fromGroup -- * Options you can pass in via tasty , HedgehogReplay(..)@@ -36,13 +37,32 @@ import Hedgehog.Internal.Report import Hedgehog.Internal.Seed as Seed -data HP = HP T.TestName Property+data HP = HP PropertyName Property deriving (Typeable) -- | Create a 'T.TestTree' from a Hedgehog 'Property'.+{-# DEPRECATED testProperty "testProperty will cause Hedgehog to provide incorrect instructions for re-checking properties" #-} testProperty :: T.TestName -> Property -> T.TestTree-testProperty name prop = T.singleTest name (HP name prop)+testProperty name prop = T.singleTest name (HP (PropertyName name) prop) +-- | `testPropertyNamed` @testName propertyName property@ creates a+-- 'T.TestTree' from @property@ using @testName@ as the displayed+-- description for the property. The @propertyName@ is used by Hedgehog+-- when a failure occurs to provide instructions for how to re-run+-- the property and should normally be set to a string representation+-- of the @property@ argument.+--+-- @+-- testPropertyNamed+-- "reverse is involutive"+-- "prop_reverse_involutive"+-- prop_reverse_involutive+-- @+--+-- @since 1.2.0.0+testPropertyNamed :: T.TestName -> PropertyName -> Property -> T.TestTree+testPropertyNamed name propName prop = T.singleTest name (HP propName prop)+ -- | Create a 'T.TestTree' from a Hedgehog 'Group'. fromGroup :: Group -> T.TestTree fromGroup group =@@ -142,11 +162,11 @@ reportOutput :: Bool -> UseColor- -> String+ -> PropertyName -> Report Result -> IO String reportOutput showReplay useColor name report = do- s <- renderResult useColor (Just (PropertyName name)) report+ s <- renderResult useColor (Just name) report pure $ case reportStatus report of Failed fr -> let
tasty-hedgehog.cabal view
@@ -1,5 +1,5 @@ name: tasty-hedgehog-version: 1.1.0.0+version: 1.2.0.0 license: BSD3 license-file: LICENCE author: Dave Laing@@ -21,10 +21,10 @@ library exposed-modules: Test.Tasty.Hedgehog- build-depends: base >= 4.8 && <4.16+ build-depends: base >= 4.8 && <4.17 , tagged >= 0.8 && < 0.9 , tasty >= 0.11 && < 1.5- , hedgehog >= 1.0.2 && < 1.0.6+ , hedgehog >= 1.0.2 && < 1.1.2 hs-source-dirs: src ghc-options: -Wall default-language: Haskell2010@@ -33,10 +33,10 @@ type: exitcode-stdio-1.0 main-is: Main.hs hs-source-dirs: test- build-depends: base >= 4.8 && <4.16+ build-depends: base >= 4.8 && <4.17 , tasty >= 0.11 && < 1.5 , tasty-expected-failure >= 0.11 && < 0.13- , hedgehog >= 1.0.2 && < 1.0.6+ , hedgehog >= 1.0.2 && < 1.1.2 , tasty-hedgehog ghc-options: -Wall default-language: Haskell2010
test/Main.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -Wno-deprecations #-} {-# language OverloadedStrings #-} module Main where @@ -45,5 +46,13 @@ prop_reverse_involutive , expectFail $ testProperty "badReverse involutive fails"- prop_badReverse_involutive+ prop_badReverse_involutive+ , testPropertyNamed+ "reverse involutive"+ "prop_reverse_involutive"+ prop_reverse_involutive+ , expectFail $ testPropertyNamed+ "badReverse involutive fails"+ "prop_badReverse_involutive"+ prop_badReverse_involutive ]