From 44dfd43b7e839454794c533883585cd551911c9a Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Tue, 4 Mar 2025 05:56:03 -0500 Subject: [PATCH] Migrate from test-framework to tasty Towards https://github.com/ekmett/lens/issues/1090 --- CHANGELOG.markdown | 4 ++++ foldable1-classes-compat.cabal | 8 ++++---- test/Tests.hs | 11 ++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 6219f2a..4efd1ce 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,5 +1,9 @@ # Revision history for foldable1-classes-compat +## next -- ????-??-?? + +* Replace `test-framework` with `tasty` in the test suite. + ## 0.1.1 -- 2024-12-05 * Drop support for pre-8.0 versions of GHC. diff --git a/foldable1-classes-compat.cabal b/foldable1-classes-compat.cabal index 6e1f84e..c1d135f 100644 --- a/foldable1-classes-compat.cabal +++ b/foldable1-classes-compat.cabal @@ -92,10 +92,10 @@ test-suite test , containers , foldable1-classes-compat , transformers - , QuickCheck >=2.13.2 && <2.16 - , quickcheck-instances >=0.3.27 && <0.4 - , test-framework >=0.8.2.0 && <0.9 - , test-framework-quickcheck2 >=0.3.0.5 && <0.4 + , QuickCheck >=2.13.2 && <2.16 + , quickcheck-instances >=0.3.27 && <0.4 + , tasty >=1.4 && <1.6 + , tasty-quickcheck >=0.10 && <0.12 benchmark bench default-language: Haskell2010 diff --git a/test/Tests.hs b/test/Tests.hs index 0b61ef6..ecf057f 100644 --- a/test/Tests.hs +++ b/test/Tests.hs @@ -23,12 +23,12 @@ import Data.Functor.Sum (Sum (..)) import Data.List.NonEmpty (NonEmpty (..)) import Data.Semigroup (First (..), Last (..), Max (..), Min (..), Semigroup (..)) -import Test.Framework.Providers.API (Test, TestName, testGroup) -import Test.Framework.Providers.QuickCheck2 (testProperty) -import Test.Framework.Runners.Console (defaultMain) import Test.QuickCheck (Arbitrary, Fun, Property, Testable, applyFun, applyFun2, counterexample, mapSize, (===)) +import Test.Tasty + (TestName, TestTree, defaultMain, testGroup) +import Test.Tasty.QuickCheck (testProperty) import Test.QuickCheck.Poly (A, B, OrdA) import Test.QuickCheck.Instances () @@ -46,7 +46,8 @@ import Data.Functor.Reverse (Reverse (..)) #endif main :: IO () -main = defaultMain +main = defaultMain $ + testGroup "foldable1-classes-compat" [ foldable1tests "NonEmpty" (P1 :: P1 NonEmpty) , foldable1tests "foldMap1" (P1 :: P1 NE1) , foldable1tests "foldrMap1" (P1 :: P1 NE3) @@ -76,7 +77,7 @@ foldable1tests ) => TestName -> P1 f - -> Test + -> TestTree foldable1tests name _p = testGroup name [ testProperty "foldMap1 ~= foldMap" coherentFoldMap , testProperty "toList . toNonEmpty ~= toList" coherentToNonEmpty