@@ -12,6 +12,7 @@ import Control.Monad
1212import Data.Bifunctor
1313import Data.Either
1414import Data.Map.Strict qualified as Map
15+ import Test.Cardano.Base.QuickCheck qualified as BaseQC
1516import Test.QuickCheck
1617
1718prop_genKindCorrect :: Property
@@ -21,7 +22,7 @@ prop_genKindCorrect = p_genKindCorrect False
2122See Note [Debugging generators that don't generate well-typed/kinded terms/types]
2223and see the utility tests below when this property fails. -}
2324p_genKindCorrect :: Bool -> Property
24- p_genKindCorrect debug = withMaxSuccess 1000 $
25+ p_genKindCorrect debug = BaseQC. withNumTests 1000 $
2526 -- Context minimality doesn't help readability, so no shrinking here
2627 forAllDoc " ctx" genCtx (const [] ) $ \ ctx ->
2728 -- Note, no shrinking here because shrinking relies on well-kindedness.
@@ -30,7 +31,7 @@ p_genKindCorrect debug = withMaxSuccess 1000 $
3031
3132-- | Check that shrinking types maintains kinds.
3233prop_shrinkTypeSound :: Property
33- prop_shrinkTypeSound = withMaxSuccess 500 $
34+ prop_shrinkTypeSound = BaseQC. withNumTests 500 $
3435 forAllDoc " ctx" genCtx (const [] ) $ \ ctx ->
3536 forAllDoc " k,ty" (genKindAndTypeWithCtx ctx) (shrinkKindAndType ctx) $ \ (k, ty) ->
3637 -- See discussion about the same trick in 'prop_shrinkTermSound'.
@@ -45,7 +46,7 @@ prop_shrinkTypeSound = withMaxSuccess 500 $
4546
4647-- | Test that shrinking a type results in a type of a smaller kind. Useful for debugging shrinking.
4748prop_shrinkTypeSmallerKind :: Property
48- prop_shrinkTypeSmallerKind = withMaxSuccess 3000 $
49+ prop_shrinkTypeSmallerKind = BaseQC. withNumTests 3000 $
4950 forAllDoc " k,ty" genKindAndType (shrinkKindAndType Map. empty) $ \ (k, ty) ->
5051 assertNoCounterexamples
5152 [ (k', ty')
@@ -55,13 +56,13 @@ prop_shrinkTypeSmallerKind = withMaxSuccess 3000 $
5556
5657-- | Test that shrinking kinds generates smaller kinds.
5758prop_shrinkKindSmaller :: Property
58- prop_shrinkKindSmaller = withMaxSuccess 30000 $
59+ prop_shrinkKindSmaller = BaseQC. withNumTests 30000 $
5960 forAllDoc " k" arbitrary shrink $ \ k ->
6061 assertNoCounterexamples [k' | k' <- shrink k, not $ leKind k' k]
6162
6263-- | Test that fixKind actually gives you something of the right kind.
6364prop_fixKind :: Property
64- prop_fixKind = withMaxSuccess 10000 $
65+ prop_fixKind = BaseQC. withNumTests 10000 $
6566 forAllDoc " ctx" genCtx (const [] ) $ \ ctx ->
6667 forAllDoc " k,ty" genKindAndType (shrinkKindAndType ctx) $ \ (k, ty) ->
6768 -- Note, fixKind only works on smaller kinds, so we use shrink to get a definitely smaller kind
@@ -74,7 +75,7 @@ prop_fixKind = withMaxSuccess 10000 $
7475
7576-- | Check that 'normalizeType' returns a normal type.
7677prop_normalizedTypeIsNormal :: Property
77- prop_normalizedTypeIsNormal = withMaxSuccess 1000 $
78+ prop_normalizedTypeIsNormal = BaseQC. withNumTests 1000 $
7879 forAllDoc " k,ty" genKindAndType (shrinkKindAndType Map. empty) $ \ (_, ty) ->
7980 unless (isNormalType . unNormalized . runQuote $ normalizeType ty) $
8081 Left " 'normalizeType' returned a non-normal type"
0 commit comments