genvalidity-hspec 0.6.2.3 → 0.7.0.0
raw patch · 4 files changed
+16/−12 lines, 4 filesdep ~genvalidityPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: genvalidity
API changes (from Hackage documentation)
- Test.Validity: failsOnInvalid2 :: (Show a, Show b, Show c, Show (f c), GenInvalid a, GenInvalid b, CanFail f) => (a -> b -> f c) -> Property
+ Test.Validity: failsOnInvalid2 :: (Show a, Show b, Show c, Show (f c), GenUnchecked a, GenUnchecked b, GenInvalid a, GenInvalid b, CanFail f) => (a -> b -> f c) -> Property
- Test.Validity: genRelativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenValid b, GenRelativeValid a b, GenRelativeInvalid a b) => Spec
+ Test.Validity: genRelativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenUnchecked b, GenValid b, GenRelativeValid a b, GenRelativeInvalid a b) => Spec
- Test.Validity: shrinkValidSpecWithLimit :: forall a. (Show a, Eq a, Typeable a, GenValid a) => Int -> Spec
+ Test.Validity: shrinkValidSpecWithLimit :: forall a. (Show a, Eq a, Typeable a, GenUnchecked a, GenValid a) => Int -> Spec
- Test.Validity.GenRelativeValidity: genRelativeInvalidSpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenValid a, GenValid b, RelativeValidity a b, GenRelativeInvalid a b) => Spec
+ Test.Validity.GenRelativeValidity: genRelativeInvalidSpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenValid a, GenUnchecked b, GenValid b, RelativeValidity a b, GenRelativeInvalid a b) => Spec
- Test.Validity.GenRelativeValidity: genRelativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenValid b, GenRelativeValid a b, GenRelativeInvalid a b) => Spec
+ Test.Validity.GenRelativeValidity: genRelativeValiditySpec :: forall a b. (Typeable a, Typeable b, Show a, Show b, GenUnchecked b, GenValid b, GenRelativeValid a b, GenRelativeInvalid a b) => Spec
- Test.Validity.Shrinking: shrinkInvalidDoesNotShrinkToItselfWithLimit :: forall a. (Show a, Eq a, GenInvalid a) => Int -> Property
+ Test.Validity.Shrinking: shrinkInvalidDoesNotShrinkToItselfWithLimit :: forall a. (Show a, Eq a, GenUnchecked a, GenInvalid a) => Int -> Property
- Test.Validity.Shrinking: shrinkValidDoesNotShrinkToItselfWithLimit :: forall a. (Show a, Eq a, GenValid a) => Int -> Property
+ Test.Validity.Shrinking: shrinkValidDoesNotShrinkToItselfWithLimit :: forall a. (Show a, Eq a, GenUnchecked a, GenValid a) => Int -> Property
- Test.Validity.Shrinking: shrinkValidSpecWithLimit :: forall a. (Show a, Eq a, Typeable a, GenValid a) => Int -> Spec
+ Test.Validity.Shrinking: shrinkValidSpecWithLimit :: forall a. (Show a, Eq a, Typeable a, GenUnchecked a, GenValid a) => Int -> Spec
Files
- genvalidity-hspec.cabal +4/−4
- src/Test/Validity/GenRelativeValidity.hs +2/−0
- src/Test/Validity/GenValidity.hs +2/−2
- src/Test/Validity/Shrinking.hs +8/−6
genvalidity-hspec.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: c9a9df67c4e4398907c737952eee38ffde3bda054a6a13747c77f10e12a64565+-- hash: 032a6b3927945fdf541b5dbf8921f9708dd352801187b0fd3165045007fdced9 name: genvalidity-hspec-version: 0.6.2.3+version: 0.7.0.0 synopsis: Standard spec's for GenValidity instances description: Note: There are companion packages for this library: .@@ -24,7 +24,7 @@ author: Tom Sydney Kerckhove maintainer: syd.kerckhove@gmail.com, nick.van.den.broeck666@gmail.com-copyright: Copyright: (c) 2016-2018 Tom Sydney Kerckhove+copyright: Copyright: (c) 2016-2019 Tom Sydney Kerckhove license: MIT license-file: LICENSE build-type: Simple@@ -56,7 +56,7 @@ build-depends: QuickCheck , base >=4.9 && <5- , genvalidity >=0.5+ , genvalidity >=0.8 , genvalidity-property >=0.2 , hspec , hspec-core
src/Test/Validity/GenRelativeValidity.hs view
@@ -40,6 +40,7 @@ , Typeable b , Show a , Show b+ , GenUnchecked b , GenValid b , GenRelativeValid a b , GenRelativeInvalid a b@@ -79,6 +80,7 @@ , Show a , Show b , GenValid a+ , GenUnchecked b , GenValid b , RelativeValidity a b , GenRelativeInvalid a b
src/Test/Validity/GenValidity.hs view
@@ -31,7 +31,7 @@ -- In general it is a good idea to add this spec to your test suite if you -- write a custom implementation of @genValid@ or @genInvalid@. ----- __It is not a good idea to use this function if invalid values are broken in such a way that 'Show' or even 'isValid' is broken. (For example, ByteString)__+-- __It is not a good idea to use this function if invalid values are broken in such a way that 'Show' or even 'isValid' is broken.__ -- In that case you probably want 'genValidSpec'. -- -- Example usage:@@ -65,7 +65,7 @@ -- | A @Spec@ that specifies that @genInvalid@ only generates invalid data. ----- Note that it is not a good idea to use this function if invalid values are broken in such a way that 'Show' or even 'isValid' is broken. (For example, ByteString)+-- Note that it is not a good idea to use this function if invalid values are broken in such a way that 'Show' or even 'isValid' is broken. -- -- Example usage: --
src/Test/Validity/Shrinking.hs view
@@ -59,13 +59,14 @@ shrinkValidDoesNotShrinkToItself @a shrinkValidSpecWithLimit ::- forall a. (Show a, Eq a, Typeable a, GenValid a)+ forall a. (Show a, Eq a, Typeable a, GenUnchecked a, GenValid a) => Int -> Spec shrinkValidSpecWithLimit l = describe ("shrinkValid :: " ++ nameOf @(a -> [a])) $ do it (unwords ["preserves validity for the first", show l, "elements"]) $- forAll (genValid @a) $ \a -> forM_ (take l $ shrinkValid a) shouldBeValid+ forAll (genValid @a) $ \a ->+ forM_ (take l $ shrinkValid a) shouldBeValid it (unwords [ "never shrinks to itself for valid values for the first"@@ -111,23 +112,24 @@ shrinkValidDoesNotShrinkToItself :: forall a. (Show a, Eq a, GenValid a) => Property-shrinkValidDoesNotShrinkToItself = shrinkDoesNotShrinkToItself @a shrinkValid+shrinkValidDoesNotShrinkToItself =+ shrinkDoesNotShrinkToItselfOnValid @a shrinkValid shrinkInvalidDoesNotShrinkToItself :: forall a. (Show a, Eq a, GenInvalid a) => Property shrinkInvalidDoesNotShrinkToItself =- shrinkDoesNotShrinkToItself @a shrinkInvalid+ shrinkDoesNotShrinkToItselfOnInvalid @a shrinkInvalid shrinkInvalidDoesNotShrinkToItselfWithLimit ::- forall a. (Show a, Eq a, GenInvalid a)+ forall a. (Show a, Eq a, GenUnchecked a, GenInvalid a) => Int -> Property shrinkInvalidDoesNotShrinkToItselfWithLimit = shrinkDoesNotShrinkToItselfWithLimit @a shrinkInvalid shrinkValidDoesNotShrinkToItselfWithLimit ::- forall a. (Show a, Eq a, GenValid a)+ forall a. (Show a, Eq a, GenUnchecked a, GenValid a) => Int -> Property shrinkValidDoesNotShrinkToItselfWithLimit =