genvalidity-sydtest 1.0.0.0 → 1.0.1.0
raw patch · 20 files changed
+138/−127 lines, 20 filesdep −pretty-showdep −validity
Dependencies removed: pretty-show, validity
Files
- CHANGELOG.md +6/−0
- genvalidity-sydtest.cabal +2/−4
- src/Test/Syd/Validity/Applicative.hs +25/−23
- src/Test/Syd/Validity/Arbitrary.hs +4/−3
- src/Test/Syd/Validity/Eq.hs +8/−8
- src/Test/Syd/Validity/Functor.hs +15/−13
- src/Test/Syd/Validity/GenValidity.hs +2/−2
- src/Test/Syd/Validity/Monad.hs +22/−22
- src/Test/Syd/Validity/Monoid.hs +18/−18
- src/Test/Syd/Validity/Operations/Identity.hs +2/−2
- src/Test/Syd/Validity/Ord.hs +10/−10
- src/Test/Syd/Validity/Relations/Antireflexivity.hs +1/−1
- src/Test/Syd/Validity/Relations/Antisymmetry.hs +3/−2
- src/Test/Syd/Validity/Relations/Reflexivity.hs +1/−1
- src/Test/Syd/Validity/Relations/Symmetry.hs +1/−1
- src/Test/Syd/Validity/Relations/Transitivity.hs +1/−1
- src/Test/Syd/Validity/Show.hs +6/−6
- src/Test/Syd/Validity/Shrinking.hs +6/−5
- src/Test/Syd/Validity/Shrinking/Property.hs +2/−2
- src/Test/Syd/Validity/Utils.hs +3/−3
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [1.0.1.0] - 2025-12-25++### Changed++* Generalised spec combinators to have type `TestDef outers ()` instead of `Spec`.+ ## [1.0.0.0] - 2021-11-20 * Compatibility with `genvalidity >= 1.0.0.0`
genvalidity-sydtest.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack name: genvalidity-sydtest-version: 1.0.0.0+version: 1.0.1.0 synopsis: Standard properties for functions on `Validity` types for the sydtest framework category: Testing homepage: https://github.com/NorfairKing/validity#readme@@ -68,9 +68,7 @@ QuickCheck , base >=4.7 && <5 , genvalidity >=1.0- , pretty-show , sydtest- , validity >=0.9 default-language: Haskell2010 test-suite genvalidity-sydtest-test
src/Test/Syd/Validity/Applicative.hs view
@@ -92,14 +92,14 @@ -- -- > applicativeSpecOnArbitrary @[] applicativeSpec ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. ( Eq (f Int), Show (f Int), Applicative f, Typeable f, GenValid (f Int) ) =>- Spec+ TestDef outers () applicativeSpec = applicativeSpecWithInts @f genValid -- | Standard test spec for properties of Applicative instances for values generated with Arbitrary instances@@ -108,16 +108,16 @@ -- -- > applicativeSpecOnArbitrary @[] applicativeSpecOnArbitrary ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Applicative f, Typeable f, Arbitrary (f Int)) =>- Spec+ TestDef outers () applicativeSpecOnArbitrary = applicativeSpecWithInts @f arbitrary applicativeSpecWithInts ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Show (f Int), Eq (f Int), Applicative f, Typeable f) => Gen (f Int) ->- Spec+ TestDef outers () applicativeSpecWithInts gen = applicativeSpecOnGens @f@@ -157,7 +157,7 @@ -- > (pure <$> (flip (++) <$> genValid)) -- > "appends in a Just" applicativeSpecOnGens ::- forall (f :: Type -> Type) (a :: Type) (b :: Type) (c :: Type).+ forall (f :: Type -> Type) (a :: Type) (b :: Type) (c :: Type) outers. ( Show a, Show (f a), Eq (f a),@@ -183,7 +183,7 @@ String -> Gen (f (b -> c)) -> String ->- Spec+ TestDef outers () applicativeSpecOnGens gena genaname gen genname genb genbname genfa genfaname genffa genffaname genffb genffbname = parallel $ describe ("Applicative " ++ nameOf @f) $ do@@ -207,7 +207,9 @@ ) $ equivalentOnGens3 ( \(Anon u) (Anon v) w ->- pure (.) <*> (u :: f (b -> c)) <*> (v :: f (a -> b))+ pure (.)+ <*> (u :: f (b -> c))+ <*> (v :: f (a -> b)) <*> (w :: f a) :: f c )@@ -253,8 +255,8 @@ (\(Anon f) x -> pure f <*> x) ((,) <$> (Anon <$> genfa) <*> gen) shrinkNothing- describe (seqrTypeStr @f) $- it+ describe (seqrTypeStr @f)+ $ it ( unwords [ "is equivalent to its default implementation 'u Type> v = pure (const id) <*> u <*> v' for", genDescr @(f a) genname,@@ -262,13 +264,13 @@ genDescr @b genbname ] )- $ equivalentOnGens2- (\u v -> u *> v)- (\u v -> pure (const id) <*> u <*> v)- ((,) <$> gen <*> genb)- shrinkNothing- describe (seqlTypeStr @f) $- it+ $ equivalentOnGens2+ (\u v -> u *> v)+ (\u v -> pure (const id) <*> u <*> v)+ ((,) <$> gen <*> genb)+ shrinkNothing+ describe (seqlTypeStr @f)+ $ it ( unwords [ "is equivalent to its default implementation 'u <* v = pure const <*> u <*> v' for", genDescr @b genbname,@@ -276,8 +278,8 @@ genDescr @(f a) genname ] )- $ equivalentOnGens2- (\u v -> u <* v)- (\u v -> pure const <*> u <*> v)- ((,) <$> gen <*> genb)- shrinkNothing+ $ equivalentOnGens2+ (\u v -> u <* v)+ (\u v -> pure const <*> u <*> v)+ ((,) <$> gen <*> genb)+ shrinkNothing
src/Test/Syd/Validity/Arbitrary.hs view
@@ -26,14 +26,15 @@ -- -- > arbitrarySpec @Int arbitrarySpec ::- forall a.+ forall a outers. (Typeable a, Show a, Validity a, Arbitrary a) =>- Spec+ TestDef outers () arbitrarySpec = do let name = nameOf @a describe ("Arbitrary " ++ name) $ describe ("arbitrary :: Gen " ++ name) $- it "only generates valid values" $ arbitraryGeneratesOnlyValid @a+ it "only generates valid values" $+ arbitraryGeneratesOnlyValid @a -- | @arbitrary@ only generates valid data --
src/Test/Syd/Validity/Eq.hs view
@@ -23,13 +23,13 @@ eqTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String eqTypeStr = binRelStr @a "==" neqTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String neqTypeStr = binRelStr @a "/=" @@ -39,9 +39,9 @@ -- -- > eqSpec @Int eqSpec ::- forall a.+ forall a outers. (Show a, Eq a, Typeable a, GenValid a) =>- Spec+ TestDef outers () eqSpec = eqSpecOnGen @a genValid "valid" shrinkValid -- | Standard test spec for properties of Eq instances for arbitrary values@@ -50,9 +50,9 @@ -- -- > eqSpecOnArbitrary @Int eqSpecOnArbitrary ::- forall a.+ forall a outers. (Show a, Eq a, Typeable a, Arbitrary a) =>- Spec+ TestDef outers () eqSpecOnArbitrary = eqSpecOnGen @a arbitrary "arbitrary" shrink -- | Standard test spec for properties of Eq instances for values generated by a given generator (and name for that generator).@@ -61,12 +61,12 @@ -- -- > eqSpecOnGen ((* 2) <$> genValid @Int) "even" eqSpecOnGen ::- forall a.+ forall a outers. (Show a, Eq a, Typeable a) => Gen a -> String -> (a -> [a]) ->- Spec+ TestDef outers () eqSpecOnGen gen genname s = parallel $ do let name = nameOf @a
src/Test/Syd/Validity/Functor.hs view
@@ -56,9 +56,9 @@ -- -- > functorSpecOnArbitrary @[] functorSpec ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Functor f, Typeable f, GenValid (f Int)) =>- Spec+ TestDef outers () functorSpec = functorSpecWithInts @f genValid -- | Standard test spec for properties of Functor instances for values generated with Arbitrary instances@@ -67,16 +67,16 @@ -- -- > functorSpecOnArbitrary @[] functorSpecOnArbitrary ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Functor f, Typeable f, Arbitrary (f Int)) =>- Spec+ TestDef outers () functorSpecOnArbitrary = functorSpecWithInts @f arbitrary functorSpecWithInts ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Functor f, Typeable f) => Gen (f Int) ->- Spec+ TestDef outers () functorSpecWithInts gen = functorSpecOnGens @f@@ -102,7 +102,7 @@ -- > ((+) <$> genValid) "additions" -- > ((*) <$> genValid) "multiplications" functorSpecOnGens ::- forall (f :: Type -> Type) (a :: Type) (b :: Type) (c :: Type).+ forall (f :: Type -> Type) (a :: Type) (b :: Type) (c :: Type) outers. ( Show a, Show (f a), Show (f c),@@ -122,7 +122,7 @@ String -> Gen (a -> b) -> String ->- Spec+ TestDef outers () functorSpecOnGens gena genaname gen genname genf genfname geng gengname = parallel $ describe ("Functor " ++ nameOf @f) $ do@@ -145,15 +145,16 @@ genDescr @(a -> b) gengname ] )- $ forAll (Anon <$> genf) $ \(Anon f) ->+ $ forAll (Anon <$> genf)+ $ \(Anon f) -> forAll (Anon <$> geng) $ \(Anon g) -> equivalentOnGen (fmap (f . g)) (fmap f . fmap g) gen shrinkNothing- describe (flTypeStr @f) $- it+ describe (flTypeStr @f)+ $ it ( unwords [ "is equivalent to its default implementation for", genDescr @a genaname,@@ -161,5 +162,6 @@ genDescr @(f a) genname ] )- $ forAll gena $ \a ->- equivalentOnGen (a <$) (fmap $ const a) gen shrinkNothing+ $ forAll gena+ $ \a ->+ equivalentOnGen (a <$) (fmap $ const a) gen shrinkNothing
src/Test/Syd/Validity/GenValidity.hs view
@@ -30,9 +30,9 @@ -- -- > genValidSpec @Int genValidSpec ::- forall a.+ forall a outers. (Typeable a, Show a, GenValid a) =>- Spec+ TestDef outers () genValidSpec = parallel $ do let name = nameOf @a
src/Test/Syd/Validity/Monad.hs view
@@ -73,9 +73,9 @@ -- -- > monadSpec @[] monadSpec ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Monad f, Typeable f, GenValid (f Int)) =>- Spec+ TestDef outers () monadSpec = monadSpecWithInts @f genValid -- | Standard test spec for properties of Monad instances for values generated with Arbitrary instances@@ -84,16 +84,16 @@ -- -- > monadSpecOnArbitrary @[] monadSpecOnArbitrary ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Monad f, Typeable f, Arbitrary (f Int)) =>- Spec+ TestDef outers () monadSpecOnArbitrary = monadSpecWithInts @f arbitrary monadSpecWithInts ::- forall (f :: Type -> Type).+ forall (f :: Type -> Type) outers. (Eq (f Int), Show (f Int), Monad f, Typeable f) => Gen (f Int) ->- Spec+ TestDef outers () monadSpecWithInts gen = monadSpecOnGens @f@@ -141,7 +141,7 @@ -- > (pure $ pure (+ 1)) -- > "increment in list" monadSpecOnGens ::- forall (f :: Type -> Type) (a :: Type) (b :: Type) (c :: Type).+ forall (f :: Type -> Type) (a :: Type) (b :: Type) (c :: Type) outers. ( Show a, Show (f a), Show (f b),@@ -169,7 +169,7 @@ String -> Gen (f (a -> b)) -> String ->- Spec+ TestDef outers () monadSpecOnGens gena genaname gen genname genb genbname geng gengname genbf genbfname gencf gencfname genfab genfabname = parallel $ describe ("Monad " ++ nameOf @f) $ do@@ -194,8 +194,8 @@ ] ) $ equivalentOnGen (\m -> m >>= return) (\m -> m) gen shrinkNothing- describe (bindTypeStr @f) $- it+ describe (bindTypeStr @f)+ $ it ( unwords [ "satisfies the third Monad law: 'm >>= (x -> k x >>= h) = (m >>= k) >>= h' for", genDescr @(f a) genname,@@ -204,11 +204,11 @@ genDescr @(b -> f c) gencfname ] )- $ equivalentOnGens3- (\m (Anon k) (Anon h) -> m >>= (\x -> k x >>= h))- (\m (Anon k) (Anon h) -> (m >>= k) >>= h)- ((,,) <$> gen <*> (Anon <$> genbf) <*> (Anon <$> gencf))- shrinkNothing+ $ equivalentOnGens3+ (\m (Anon k) (Anon h) -> m >>= (\x -> k x >>= h))+ (\m (Anon k) (Anon h) -> (m >>= k) >>= h)+ ((,,) <$> gen <*> (Anon <$> genbf) <*> (Anon <$> gencf))+ shrinkNothing describe (unwords ["relation with Applicative", nameOf @f]) $ do it ( unwords@@ -237,8 +237,8 @@ ] ) $ equivalentOnGens2 (>>) (*>) ((,) <$> gen <*> genb) shrinkNothing- describe (unwords ["relation with Functor", nameOf @f]) $- it+ describe (unwords ["relation with Functor", nameOf @f])+ $ it ( unwords [ "satisfies 'fmap f xs = xs >>= return . f' for", genDescr @(a -> b) gengname,@@ -246,8 +246,8 @@ genDescr @(f a) genname ] )- $ equivalentOnGens2- (\(Anon f) xs -> fmap f xs)- (\(Anon f) xs -> xs >>= (return . f))- ((,) <$> (Anon <$> geng) <*> gen)- shrinkNothing+ $ equivalentOnGens2+ (\(Anon f) xs -> fmap f xs)+ (\(Anon f) xs -> xs >>= (return . f))+ ((,) <$> (Anon <$> geng) <*> gen)+ shrinkNothing
src/Test/Syd/Validity/Monoid.hs view
@@ -23,13 +23,13 @@ memptyTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String memptyTypeStr = unwords ["mempty", "::", nameOf @a] mappendTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String mappendTypeStr = unwords ["mappend", "::", an, "->", an, "->", an] where@@ -37,7 +37,7 @@ mconcatTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String mconcatTypeStr = unwords ["mconcat", "::", "[" ++ an ++ "]", "->", an] where@@ -49,9 +49,9 @@ -- -- > monoidSpec @[Int] monoidSpec ::- forall a.+ forall a outers. (Show a, Eq a, Monoid a, Typeable a, GenValid a) =>- Spec+ TestDef outers () monoidSpec = monoidSpecOnGen @a genValid "valid" shrinkValid -- | Standard test spec for properties of 'Monoid' instances for arbitrary values@@ -60,9 +60,9 @@ -- -- > monoidSpecOnArbitrary @[Int] monoidSpecOnArbitrary ::- forall a.+ forall a outers. (Show a, Eq a, Monoid a, Typeable a, Arbitrary a) =>- Spec+ TestDef outers () monoidSpecOnArbitrary = monoidSpecOnGen @a arbitrary "arbitrary" shrink -- | Standard test spec for properties of Monoid instances for values generated by a given generator (and name for that generator).@@ -71,12 +71,12 @@ -- -- > monoidSpecOnGen (pure "a") "singleton list of 'a'" monoidSpecOnGen ::- forall a.+ forall a outers. (Show a, Eq a, Monoid a, Typeable a) => Gen a -> String -> (a -> [a]) ->- Spec+ TestDef outers () monoidSpecOnGen gen genname s = parallel $ do let name = nameOf @a@@ -91,8 +91,8 @@ let mem = mempty @a mapp = mappend @a mcon = mconcat @a- describe memptystr $- it+ describe memptystr+ $ it ( unwords [ "is the identity for", mappendstr,@@ -100,20 +100,20 @@ genDescr @a genname ] )- $ identityOnGen mapp mem gen s- describe mappendstr $- it+ $ identityOnGen mapp mem gen s+ describe mappendstr+ $ it ( unwords [ "is an associative operation for", genDescr @(a, a, a) genname ] )- $ associativeOnGens mapp gen3 s3- describe mconcatstr $- it+ $ associativeOnGens mapp gen3 s3+ describe mconcatstr+ $ it ( unwords [ "is equivalent to its default implementation for", genDescr @[a] genname ] )- $ equivalentOnGen mcon (foldr mapp mem) genl sl+ $ equivalentOnGen mcon (foldr mapp mem) genl sl
src/Test/Syd/Validity/Operations/Identity.hs view
@@ -41,7 +41,7 @@ leftIdentityOnElemWithEquality op eq b a = (b `op` a) `eq` a leftIdentityOnGenWithEquality ::- Show a =>+ (Show a) => -- | A binary operation (b -> a -> a) -> -- | An equality@@ -98,7 +98,7 @@ rightIdentityOnElemWithEquality op eq b a = (a `op` b) `eq` a rightIdentityOnGenWithEquality ::- Show a =>+ (Show a) => -- | A binary operation (a -> b -> a) -> -- | An equality
src/Test/Syd/Validity/Ord.hs view
@@ -32,25 +32,25 @@ leTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String leTypeStr = binRelStr @a "<=" geTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String geTypeStr = binRelStr @a ">=" ltTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String ltTypeStr = binRelStr @a "<" gtTypeStr :: forall a.- Typeable a =>+ (Typeable a) => String gtTypeStr = binRelStr @a ">" @@ -60,9 +60,9 @@ -- -- > ordSpec @Int ordSpec ::- forall a.+ forall a outers. (Show a, Ord a, Typeable a, GenValid a) =>- Spec+ TestDef outers () ordSpec = ordSpecOnGen @a genValid "valid" shrinkValid -- | Standard test spec for properties of Ord instances for arbitrary values@@ -71,9 +71,9 @@ -- -- > ordSpecOnArbitrary @Int ordSpecOnArbitrary ::- forall a.+ forall a outers. (Show a, Ord a, Typeable a, Arbitrary a) =>- Spec+ TestDef outers () ordSpecOnArbitrary = ordSpecOnGen @a arbitrary "arbitrary" shrink -- | Standard test spec for properties of Ord instances for values generated by a given generator (and name for that generator).@@ -82,12 +82,12 @@ -- -- > ordSpecOnGen ((* 2) <$> genValid @Int) "even" ordSpecOnGen ::- forall a.+ forall a outers. (Show a, Ord a, Typeable a) => Gen a -> String -> (a -> [a]) ->- Spec+ TestDef outers () ordSpecOnGen gen genname s = parallel $ do let name = nameOf @a
src/Test/Syd/Validity/Relations/Antireflexivity.hs view
@@ -28,7 +28,7 @@ antireflexiveOnElem func a = not $ func a a antireflexivityOnGen ::- Show a => (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property+ (Show a) => (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property antireflexivityOnGen func gen s = forAllShrink gen s $ antireflexiveOnElem func -- |
src/Test/Syd/Validity/Relations/Antisymmetry.hs view
@@ -34,7 +34,7 @@ (func a b && func b a) ===> (a `eq` b) antisymmetryOnGensWithEquality ::- Show a =>+ (Show a) => (a -> a -> Bool) -> Gen (a, a) -> (a -> a -> Bool) ->@@ -42,7 +42,8 @@ Property antisymmetryOnGensWithEquality func gen eq s = forAllShrink gen (shrinkT2 s) $- uncurry $ antisymmetricOnElemsWithEquality func eq+ uncurry $+ antisymmetricOnElemsWithEquality func eq antisymmetryOnGens :: (Show a, Eq a) =>
src/Test/Syd/Validity/Relations/Reflexivity.hs view
@@ -28,7 +28,7 @@ reflexiveOnElem func a = func a a reflexivityOnGen ::- Show a => (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property+ (Show a) => (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property reflexivityOnGen func gen s = forAllShrink gen s $ reflexiveOnElem func -- |
src/Test/Syd/Validity/Relations/Symmetry.hs view
@@ -30,7 +30,7 @@ symmetricOnElems func a b = func a b <==> func b a symmetryOnGens ::- Show a => (a -> a -> Bool) -> Gen (a, a) -> (a -> [a]) -> Property+ (Show a) => (a -> a -> Bool) -> Gen (a, a) -> (a -> [a]) -> Property symmetryOnGens func gen s = forAllShrink gen (shrinkT2 s) $ uncurry $ symmetricOnElems func
src/Test/Syd/Validity/Relations/Transitivity.hs view
@@ -31,7 +31,7 @@ transitiveOnElems func a b c = (func a b && func b c) ===> func a c transitivityOnGens ::- Show a => (a -> a -> Bool) -> Gen (a, a, a) -> (a -> [a]) -> Property+ (Show a) => (a -> a -> Bool) -> Gen (a, a, a) -> (a -> [a]) -> Property transitivityOnGens func gen s = forAllShrink gen (shrinkT3 s) $ \(a, b, c) -> transitiveOnElems func a b c
src/Test/Syd/Validity/Show.hs view
@@ -27,9 +27,9 @@ -- -- > showReadSpec @Int showReadSpec ::- forall a.+ forall a outers. (Show a, Eq a, Read a, Typeable a, GenValid a) =>- Spec+ TestDef outers () showReadSpec = showReadSpecOnGen @a genValid "valid" shrinkValid -- | Standard test spec for properties of Show and Read instances for arbitrary values@@ -38,9 +38,9 @@ -- -- > showReadSpecOnArbitrary @Double showReadSpecOnArbitrary ::- forall a.+ forall a outers. (Show a, Eq a, Read a, Typeable a, Arbitrary a) =>- Spec+ TestDef outers () showReadSpecOnArbitrary = showReadSpecOnGen @a arbitrary "arbitrary" shrink -- | Standard test spec for properties of Show and Read instances for values generated by a custom generator@@ -49,12 +49,12 @@ -- -- > showReadSpecOnGen ((* 2) <$> genValid @Int) "even" (const []) showReadSpecOnGen ::- forall a.+ forall a outers. (Show a, Eq a, Read a, Typeable a) => Gen a -> String -> (a -> [a]) ->- Spec+ TestDef outers () showReadSpecOnGen gen n s = describe (unwords ["Show", nameOf @a, "and Read", nameOf @a]) $ it (unwords ["are implemented such that read . show == id for", n, "values"]) $
src/Test/Syd/Validity/Shrinking.hs view
@@ -29,21 +29,22 @@ import Test.Syd.Validity.Utils shrinkValidSpec ::- forall a.+ forall a outers. (Show a, Eq a, Typeable a, GenValid a) =>- Spec+ TestDef outers () shrinkValidSpec = describe ("shrinkValid :: " ++ nameOf @(a -> [a])) $ do it "preserves validity" $- forAll (genValid @a) $ \a -> forM_ (shrinkValid a) shouldBeValid+ forAll (genValid @a) $+ \a -> forM_ (shrinkValid a) shouldBeValid it "never shrinks to itself for valid values" $ shrinkValidDoesNotShrinkToItself @a shrinkValidSpecWithLimit ::- forall a.+ forall a outers. (Show a, Eq a, Typeable a, GenValid a) => Int ->- Spec+ TestDef outers () shrinkValidSpecWithLimit l = describe ("shrinkValid :: " ++ nameOf @(a -> [a])) $ do it (unwords ["preserves validity for the first", show l, "elements"]) $
src/Test/Syd/Validity/Shrinking/Property.hs view
@@ -71,7 +71,7 @@ -- prop> shrinkingPreserves (pure 5 :: Gen Int) (:[]) (== 5) shrinkingPreserves :: forall a.- Show a =>+ (Show a) => Gen a -> (a -> [a]) -> (a -> Bool) ->@@ -83,7 +83,7 @@ -- prop> shrinkingPreservesWithLimit (pure 4) (:[]) 100 (== 4) shrinkingPreservesWithLimit :: forall a.- Show a =>+ (Show a) => Gen a -> (a -> [a]) -> Int ->
src/Test/Syd/Validity/Utils.hs view
@@ -22,7 +22,7 @@ nameOf :: forall a.- Typeable a =>+ (Typeable a) => String nameOf = let s = show $ typeRep (Proxy @a)@@ -32,14 +32,14 @@ genDescr :: forall a.- Typeable a =>+ (Typeable a) => String -> String genDescr genname = unwords ["\"" ++ genname, "::", nameOf @a ++ "\""] binRelStr :: forall a.- Typeable a =>+ (Typeable a) => String -> String binRelStr op = unwords ["(" ++ op ++ ")", "::", name, "->", name, "->", "Bool"]