Skip to content

Commit b7a79aa

Browse files
authored
Migrate tests from test-framework to tasty (#316)
1 parent 7d93030 commit b7a79aa

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

tests/HashMapProperties.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{-# OPTIONS_GHC -fno-warn-orphans #-} -- because of Arbitrary (HashMap k v)
33

44
-- | Tests for the 'Data.HashMap.Lazy' module. We test functions by
5-
-- comparing them to a simpler model, an association list.
5+
-- comparing them to @Map@ from @containers@.
66

77
module Main (main) where
88

@@ -25,8 +25,8 @@ import qualified Data.HashMap.Lazy as HM
2525
import qualified Data.Map.Lazy as M
2626
#endif
2727
import Test.QuickCheck (Arbitrary(..), Property, (==>), (===), forAll, elements)
28-
import Test.Framework (Test, defaultMain, testGroup)
29-
import Test.Framework.Providers.QuickCheck2 (testProperty)
28+
import Test.Tasty (TestTree, defaultMain, testGroup)
29+
import Test.Tasty.QuickCheck (testProperty)
3030
import Data.Functor.Identity (Identity (..))
3131
import Control.Applicative (Const (..))
3232
import Test.QuickCheck.Function (Fun, apply)
@@ -440,8 +440,8 @@ pKeys = (L.sort . M.keys) `eq` (L.sort . HM.keys)
440440
------------------------------------------------------------------------
441441
-- * Test list
442442

443-
tests :: [Test]
444-
tests =
443+
tests :: TestTree
444+
tests = testGroup "HashMap properties"
445445
[
446446
-- Instances
447447
testGroup "instances"

tests/HashSetProperties.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving #-}
22

33
-- | Tests for the 'Data.HashSet' module. We test functions by
4-
-- comparing them to a simpler model, a list.
4+
-- comparing them to @Set@ from @containers@.
55

66
module Main (main) where
77

@@ -12,8 +12,8 @@ import qualified Data.HashSet as S
1212
import qualified Data.Set as Set
1313
import Data.Ord (comparing)
1414
import Test.QuickCheck (Arbitrary, Property, (==>), (===))
15-
import Test.Framework (Test, defaultMain, testGroup)
16-
import Test.Framework.Providers.QuickCheck2 (testProperty)
15+
import Test.Tasty (TestTree, defaultMain, testGroup)
16+
import Test.Tasty.QuickCheck (testProperty)
1717

1818
-- Key type that generates more hash collisions.
1919
newtype Key = K { unK :: Int }
@@ -159,8 +159,8 @@ pToList = Set.toAscList `eq` toAscList
159159
------------------------------------------------------------------------
160160
-- * Test list
161161

162-
tests :: [Test]
163-
tests =
162+
tests :: TestTree
163+
tests = testGroup "HashSet properties"
164164
[
165165
-- Instances
166166
testGroup "instances"

tests/List.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import Data.HashMap.Internal.List
44
import Data.List (nub, sort, sortBy)
55
import Data.Ord (comparing)
66

7-
import Test.Framework (Test, defaultMain, testGroup)
8-
import Test.Framework.Providers.QuickCheck2 (testProperty)
7+
import Test.Tasty (TestTree, defaultMain, testGroup)
8+
import Test.Tasty.QuickCheck (testProperty)
99
import Test.QuickCheck ((==>), (===), property, Property)
1010

11-
tests :: Test
11+
tests :: TestTree
1212
tests = testGroup "Data.HashMap.Internal.List"
1313
[ testProperty "isPermutationBy" pIsPermutation
1414
, testProperty "isPermutationBy of different length" pIsPermutationDiffLength
@@ -65,4 +65,4 @@ pUnorderedCompare xs ys =
6565
unorderedCompare compare xs ys === modelUnorderedCompare xs ys
6666

6767
main :: IO ()
68-
main = defaultMain [tests]
68+
main = defaultMain tests

tests/Regressions.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import System.Mem (performGC)
1616
import System.Mem.Weak (mkWeakPtr, deRefWeak)
1717
import System.Random (randomIO)
1818
import Test.HUnit (Assertion, assert)
19-
import Test.Framework (Test, defaultMain)
20-
import Test.Framework.Providers.HUnit (testCase)
21-
import Test.Framework.Providers.QuickCheck2 (testProperty)
19+
import Test.Tasty (TestTree, defaultMain, testGroup)
20+
import Test.Tasty.HUnit (testCase)
21+
import Test.Tasty.QuickCheck (testProperty)
2222
import Test.QuickCheck
2323

2424
issue32 :: Assertion
@@ -126,8 +126,8 @@ issue254Strict = do
126126
------------------------------------------------------------------------
127127
-- * Test list
128128

129-
tests :: [Test]
130-
tests =
129+
tests :: TestTree
130+
tests = testGroup "Regression tests"
131131
[
132132
testCase "issue32" issue32
133133
, testCase "issue39a" issue39

tests/Strictness.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module Main (main) where
55

66
import Data.Hashable (Hashable(hashWithSalt))
77
import Test.ChasingBottoms.IsBottom
8-
import Test.Framework (Test, defaultMain, testGroup)
9-
import Test.Framework.Providers.QuickCheck2 (testProperty)
8+
import Test.Tasty (TestTree, defaultMain, testGroup)
9+
import Test.Tasty.QuickCheck (testProperty)
1010
import Test.QuickCheck (Arbitrary(arbitrary), Property, (===), (.&&.))
1111
import Test.QuickCheck.Function
1212
import Test.QuickCheck.Poly (A)
@@ -149,8 +149,8 @@ pFromListWithValueResultStrict lst comb_lazy calc_good_raw
149149
------------------------------------------------------------------------
150150
-- * Test list
151151

152-
tests :: [Test]
153-
tests =
152+
tests :: TestTree
153+
tests = testGroup "Strictness tests"
154154
[
155155
-- Basic interface
156156
testGroup "HashMap.Strict"

unordered-containers.cabal

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ test-suite hashmap-lazy-properties
8888
containers >= 0.5.8,
8989
hashable >= 1.0.1.1,
9090
QuickCheck >= 2.4.0.1,
91-
test-framework >= 0.3.3,
92-
test-framework-quickcheck2 >= 0.2.9,
91+
tasty >= 1.4.0.3,
92+
tasty-quickcheck >= 0.10.1.2,
9393
unordered-containers
9494

9595
default-language: Haskell2010
@@ -106,8 +106,8 @@ test-suite hashmap-strict-properties
106106
containers >= 0.5.8,
107107
hashable >= 1.0.1.1,
108108
QuickCheck >= 2.4.0.1,
109-
test-framework >= 0.3.3,
110-
test-framework-quickcheck2 >= 0.2.9,
109+
tasty >= 1.4.0.3,
110+
tasty-quickcheck >= 0.10.1.2,
111111
unordered-containers
112112

113113
default-language: Haskell2010
@@ -124,8 +124,8 @@ test-suite hashset-properties
124124
containers >= 0.4.2.0,
125125
hashable >= 1.0.1.1,
126126
QuickCheck >= 2.4.0.1,
127-
test-framework >= 0.3.3,
128-
test-framework-quickcheck2 >= 0.2.9,
127+
tasty >= 1.4.0.3,
128+
tasty-quickcheck >= 0.10.1.2,
129129
unordered-containers
130130

131131
default-language: Haskell2010
@@ -143,8 +143,8 @@ test-suite list-tests
143143
base,
144144
containers >= 0.4,
145145
QuickCheck >= 2.4.0.1,
146-
test-framework >= 0.3.3,
147-
test-framework-quickcheck2 >= 0.2.9
146+
tasty >= 1.4.0.3,
147+
tasty-quickcheck >= 0.10.1.2
148148

149149
default-language: Haskell2010
150150
ghc-options: -Wall
@@ -161,9 +161,9 @@ test-suite regressions
161161
HUnit,
162162
QuickCheck >= 2.4.0.1,
163163
random,
164-
test-framework >= 0.3.3,
165-
test-framework-hunit,
166-
test-framework-quickcheck2,
164+
tasty >= 1.4.0.3,
165+
tasty-hunit >= 0.10.0.3,
166+
tasty-quickcheck >= 0.10.1.2,
167167
unordered-containers
168168

169169
default-language: Haskell2010
@@ -181,8 +181,8 @@ test-suite strictness-properties
181181
containers >= 0.4.2,
182182
hashable >= 1.0.1.1,
183183
QuickCheck >= 2.4.0.1,
184-
test-framework >= 0.3.3,
185-
test-framework-quickcheck2 >= 0.2.9,
184+
tasty >= 1.4.0.3,
185+
tasty-quickcheck >= 0.10.1.2,
186186
unordered-containers
187187

188188
default-language: Haskell2010

0 commit comments

Comments
 (0)