packages feed

tasty-discover 4.2.4 → 5.0.0

raw patch · 6 files changed

+16/−36 lines, 6 filesdep ~hspecdep ~tasty-hedgehog

Dependency ranges changed: hspec, tasty-hedgehog

Files

CHANGELOG.md view
@@ -8,6 +8,12 @@ [Keep a Changelog]: http://keepachangelog.com/ [Semantic Versioning]: http://semver.org/ +# 5.0.0 [2022-07-08]++- Fix tasty-hedgehog `testProperty` deprecation warning++# 4.2.4 [2022-05-22]+ - Support for custom test libraries - Version module - Deduplicate imports in generated code
README.md view
@@ -245,33 +245,6 @@  Please see [#145](https://git.coop/lwm/tasty-discover/issues/145) for more information. -## Deprecation warnings--If you see the `testProperty` deprecation warnings like the following:--```-test/Driver.hs:77:17: warning: [-Wdeprecations]-    In the use of ‘testProperty’ (imported from Test.Tasty.Hedgehog):-    Deprecated: "testProperty will cause Hedgehog to provide incorrect instructions for re-checking properties"-   |-77 |   t16 <- pure $ H.testProperty "reverse" DiscoverTest.hprop_reverse-   |                 ^^^^^^^^^^^^^^-```--There are two ways to fix it:--One is to suppress the warning.  This can be done for example with an adjustment to the-Driver preprocessing with the `-Wno-deprecations` option:--```-{-# OPTIONS_GHC -Wno-deprecations -F -pgmF tasty-discover -optF --hide-successes #-}-```--Taking this option, whilst quick an easy, risks missing important deprecation warnings however.--The recommended option is define a `Tasty` type class instance for hedgehog.  An example can be-found in `DiscoverTest` module.- # Maintenance  If you're interested in helping maintain this package, please let [@newhoggy] know!
src/Test/Tasty/Discover/Internal/Generator.hs view
@@ -89,9 +89,9 @@ hedgehogPropertyGenerator :: Generator hedgehogPropertyGenerator = Generator   { generatorPrefix   = "hprop_"-  , generatorImports  = ["import qualified Test.Tasty.Hedgehog as H"]+  , generatorImports  = ["import qualified Test.Tasty.Hedgehog as H", "import Data.String (fromString)"]   , generatorClass    = ""-  , generatorSetup    = \t -> "pure $ H.testProperty \"" ++ name t ++ "\" " ++ qualifyFunction t+  , generatorSetup    = \t -> "pure $ H.testPropertyNamed \"" ++ name t ++ "\" (fromString \"" ++ qualifyFunction t ++ "\") " ++ qualifyFunction t   }  -- | Quickcheck group generator prefix.
tasty-discover.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2  name:                   tasty-discover-version:                4.2.4+version:                5.0.0 synopsis:               Test discovery for the tasty framework. description:            Automatic test discovery and runner for the tasty framework.                       @@ -21,7 +21,7 @@ author:                 Luke Murphy maintainer:             John Ky <newhoggy@gmail.com> copyright:              2016 Luke Murphy-                        2020-2021 John Ky+                        2020-2022 John Ky license:                MIT license-file:           LICENSE tested-with:            GHC == 9.2.2, GHC == 9.0.2, GHC == 8.10.7, GHC == 8.8.4, GHC == 8.6.5@@ -41,12 +41,12 @@ common filepath                   { build-depends: filepath                   >= 1.3      && < 2.0      } common Glob                       { build-depends: Glob                       >= 0.8      && < 1.0      } common hedgehog                   { build-depends: hedgehog                   >= 1.0      && < 2.0      }-common hspec                      { build-depends: hspec                      >= 2.7      && < 2.9      }+common hspec                      { build-depends: hspec                      >= 2.7      && < 2.10     } common hspec-core                 { build-depends: hspec-core                 >= 2.7.10   && < 2.11     } common tasty                      { build-depends: tasty                      >= 1.3      && < 2.0      } common tasty-discover             { build-depends: tasty-discover             >= 4.0      && < 5.0      } common tasty-golden               { build-depends: tasty-golden               >= 2.0      && < 3.0      }-common tasty-hedgehog             { build-depends: tasty-hedgehog             >= 1.1      && < 2.0      }+common tasty-hedgehog             { build-depends: tasty-hedgehog             >= 1.2      && < 2.0      } common tasty-hspec                { build-depends: tasty-hspec                >= 1.1      && < 1.3      } common tasty-hunit                { build-depends: tasty-hunit                >= 0.10     && < 0.11     } common tasty-quickcheck           { build-depends: tasty-quickcheck           >= 0.10     && < 0.11     }
test/DiscoverTest.hs view
@@ -69,7 +69,7 @@ test_generateTrees = pure (map (\s -> testCase s $ pure ()) ["First input", "Second input"])  --------------------------------------------------------------------------------------------------- How to add custom support for hedgehog to avoid deprecation warning from tasty-hedgehog+-- How to simultaneously support tasty-hedgehog <1.2 and ^>1.2 using a custom test  newtype Property = Property   { unProperty :: H.Property@@ -93,7 +93,7 @@   reverse (reverse xs) H.=== xs  --------------------------------------------------------------------------------------------------- How to use tasty-hedgehog up to version 1.1+-- How to use the latest version of tasty-hedgehog  {- HLINT ignore "Avoid reverse" -} hprop_reverse :: H.Property
test/Driver.hs view
@@ -4,6 +4,7 @@  module Main (main, ingredients, tests) where +import Data.String (fromString) import Prelude import qualified ConfigTest import qualified DiscoverTest@@ -72,7 +73,7 @@    t15 <- TD.tasty (TD.description "reverse" <> TD.name "DiscoverTest.tasty_reverse") DiscoverTest.tasty_reverse -  t16 <- pure $ H.testProperty "reverse" DiscoverTest.hprop_reverse+  t16 <- pure $ H.testPropertyNamed "reverse" (fromString "DiscoverTest.hprop_reverse") DiscoverTest.hprop_reverse    t17 <- pure $ QC.testProperty "additionCommutative" SubMod.FooBaz.prop_additionCommutative