Skip to content

Commit

Permalink
Migrate from test-framework to tasty
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Mar 4, 2025
1 parent de8eef2 commit 44dfd43
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 4 additions & 4 deletions foldable1-classes-compat.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions test/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand All @@ -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)
Expand Down Expand Up @@ -76,7 +77,7 @@ foldable1tests
)
=> TestName
-> P1 f
-> Test
-> TestTree
foldable1tests name _p = testGroup name
[ testProperty "foldMap1 ~= foldMap" coherentFoldMap
, testProperty "toList . toNonEmpty ~= toList" coherentToNonEmpty
Expand Down

0 comments on commit 44dfd43

Please sign in to comment.