packages feed

genvalidity-property 0.2.1.1 → 0.3.0.0

raw patch · 7 files changed

+37/−36 lines, 7 filesdep ~directorydep ~filepathdep ~genvalidityPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: directory, filepath, genvalidity, validity

API changes (from Hackage documentation)

- Test.Validity.Types: instance Test.Validity.Types.CanFail GHC.Base.Maybe
+ Test.Validity.Types: instance Test.Validity.Types.CanFail GHC.Maybe.Maybe

Files

genvalidity-property.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 7b970b7101085c6f2eda0c57833c5b53113e75326b5b1d24faeef8e6b4d102a1+-- hash: e10039becc2df447bf74a5317c786e342f17d4408e0c705530ef0e5fbd93a8f1  name:           genvalidity-property-version:        0.2.1.1+version:        0.3.0.0 synopsis:       Standard properties for functions on `Validity` types description:    Standard properties for functions on `Validity` types category:       Testing@@ -54,9 +54,9 @@   build-depends:       QuickCheck     , base >=4.7 && <5-    , genvalidity >=0.5+    , genvalidity >=0.7     , hspec >=2.1-    , validity >=0.5+    , validity >=0.9   default-language: Haskell2010  test-suite genvalidity-property-doctests@@ -69,8 +69,8 @@   ghc-options: -threaded   build-depends:       base-    , directory >=1.2 && <1.4+    , directory >=1.2     , doctest-    , filepath >=1.3 && <1.5+    , filepath >=1.3     , genvalidity-property   default-language: Haskell2010
src/Test/Validity/Operations/Commutativity.hs view
@@ -32,8 +32,8 @@  -- | ----- prop> commutativeOnValids ((+) :: Double -> Double -> Double)--- prop> commutativeOnValids ((*) :: Double -> Double -> Double)+-- prop> commutativeOnValids ((+) :: Rational -> Rational -> Rational)+-- prop> commutativeOnValids ((*) :: Rational -> Rational -> Rational) commutativeOnValids :: (Show a, Eq a, GenValid a) => (a -> a -> a) -> Property commutativeOnValids op = commutativeOnGens op genValid shrinkValid 
src/Test/Validity/Operations/Identity.hs view
@@ -61,7 +61,7 @@  -- | ----- prop> leftIdentityOnValid (flip ((^) :: Double -> Int -> Double)) 1+-- prop> leftIdentityOnValid (flip ((^) :: Rational -> Int -> Rational)) 1 leftIdentityOnValid ::        (Show a, Eq a, GenValid a) => (b -> a -> a) -> b -> Property leftIdentityOnValid op b = leftIdentityOnGen op b genValid shrinkValid@@ -116,7 +116,7 @@  -- | ----- prop> rightIdentityOnValid ((^) :: Double -> Int -> Double) 1+-- prop> rightIdentityOnValid ((^) :: Rational -> Int -> Rational) 1 rightIdentityOnValid ::        (Show a, Eq a, GenValid a) => (a -> b -> a) -> b -> Property rightIdentityOnValid op b = rightIdentityOnGen op b genValid shrinkValid@@ -149,8 +149,8 @@  -- | ----- prop> identityOnValid ((*) :: Double -> Double -> Double) 1--- prop> identityOnValid ((+) :: Double -> Double -> Double) 0+-- prop> identityOnValid ((*) :: Rational -> Rational -> Rational) 1+-- prop> identityOnValid ((+) :: Rational -> Rational -> Rational) 0 identityOnValid :: (Show a, Eq a, GenValid a) => (a -> a -> a) -> a -> Property identityOnValid op a = identityOnGen op a genValid shrinkValid 
src/Test/Validity/Property/Utils.hs view
@@ -13,9 +13,11 @@ import Data.GenValidity import Test.Hspec import Test.QuickCheck+ #if !MIN_VERSION_base(4,8,0) import Control.Applicative (pure) #endif+ forAllUnchecked ::        (Show a, GenUnchecked a, Testable prop) => (a -> prop) -> Property forAllUnchecked = forAllShrink genUnchecked shrinkUnchecked@@ -35,7 +37,7 @@  shouldBeValid :: (Show a, Validity a) => a -> Expectation shouldBeValid a =-    case prettyValidation a of+    case prettyValidate a of         Right _ -> pure ()         Left err ->             expectationFailure $@@ -49,7 +51,7 @@  shouldBeInvalid :: (Show a, Validity a) => a -> Expectation shouldBeInvalid a =-    case prettyValidation a of+    case prettyValidate a of         Right _ ->             expectationFailure $             unlines
src/Test/Validity/Relations/Antireflexivity.hs view
@@ -32,9 +32,9 @@  -- | ----- prop> antireflexivityOnValid ((<) :: Double -> Double -> Bool)--- prop> antireflexivityOnValid ((/=) :: Double -> Double -> Bool)--- prop> antireflexivityOnValid ((>) :: Double -> Double -> Bool)+-- prop> antireflexivityOnValid ((<) :: Rational -> Rational -> Bool)+-- prop> antireflexivityOnValid ((/=) :: Rational -> Rational -> Bool)+-- prop> antireflexivityOnValid ((>) :: Rational -> Rational -> Bool) antireflexivityOnValid :: (Show a, GenValid a) => (a -> a -> Bool) -> Property antireflexivityOnValid func = antireflexivityOnGen func genValid shrinkValid 
src/Test/Validity/Relations/Reflexivity.hs view
@@ -32,12 +32,12 @@  -- | ----- prop> reflexivityOnValid ((<=) :: Double -> Double -> Bool)--- prop> reflexivityOnValid ((==) :: Double -> Double -> Bool)--- prop> reflexivityOnValid ((>=) :: Double -> Double -> Bool)--- prop> reflexivityOnValid (Data.List.isPrefixOf :: [Double] -> [Double] -> Bool)--- prop> reflexivityOnValid (Data.List.isSuffixOf :: [Double] -> [Double] -> Bool)--- prop> reflexivityOnValid (Data.List.isInfixOf :: [Double] -> [Double] -> Bool)+-- prop> reflexivityOnValid ((<=) :: Rational -> Rational -> Bool)+-- prop> reflexivityOnValid ((==) :: Rational -> Rational -> Bool)+-- prop> reflexivityOnValid ((>=) :: Rational -> Rational -> Bool)+-- prop> reflexivityOnValid (Data.List.isPrefixOf :: [Rational] -> [Rational] -> Bool)+-- prop> reflexivityOnValid (Data.List.isSuffixOf :: [Rational] -> [Rational] -> Bool)+-- prop> reflexivityOnValid (Data.List.isInfixOf :: [Rational] -> [Rational] -> Bool) reflexivityOnValid :: (Show a, GenValid a) => (a -> a -> Bool) -> Property reflexivityOnValid func = reflexivityOnGen func genValid shrinkValid 
src/Test/Validity/Shrinking/Property.hs view
@@ -29,7 +29,7 @@  -- | ----- prop> shrinkPreservesValidOnGenValid (:[])+-- prop> shrinkPreservesValidOnGenValid ((:[]) :: Int -> [Int]) shrinkPreservesValidOnGenValid ::        forall a. (Show a, GenValid a)     => (a -> [a])@@ -38,7 +38,7 @@  -- | ----- prop> shrinkPreservesInvalidOnGenInvalid (:[])+-- prop> shrinkPreservesInvalidOnGenInvalid ((:[]) :: Rational -> [Rational]) shrinkPreservesInvalidOnGenInvalid ::        forall a. (Show a, GenInvalid a)     => (a -> [a])@@ -47,7 +47,7 @@  -- | ----- prop> shrinkValidPreservesValid (pure 5)+-- prop> shrinkValidPreservesValid (pure 5 :: Gen Rational) shrinkValidPreservesValid ::        forall a. (Show a, GenValid a)     => Gen a@@ -56,7 +56,6 @@  -- | ----- prop> shrinkInvalidPreservesInvalid (pure (1/0) :: Gen Double) shrinkInvalidPreservesInvalid ::        forall a. (Show a, GenInvalid a)     => Gen a@@ -97,7 +96,7 @@  -- | ----- prop> shrinkingPreserves (pure 5) (:[]) (== 5)+-- prop> shrinkingPreserves (pure 5 :: Gen Int) (:[]) (== 5) shrinkingPreserves ::        forall a. Show a     => Gen a@@ -121,7 +120,7 @@  -- | ----- prop> shrinkDoesNotShrinkToItself shrinkUnchecked+-- prop> shrinkDoesNotShrinkToItself (shrinkUnchecked :: Double -> [Double]) shrinkDoesNotShrinkToItself ::        forall a. (Show a, Eq a, GenUnchecked a)     => (a -> [a])@@ -130,7 +129,7 @@  -- | ----- prop> shrinkDoesNotShrinkToItselfWithLimit shrinkUnchecked 100+-- prop> shrinkDoesNotShrinkToItselfWithLimit (shrinkUnchecked :: Double -> [Double]) 100 shrinkDoesNotShrinkToItselfWithLimit ::        forall a. (Show a, Eq a, GenUnchecked a)     => (a -> [a])@@ -141,7 +140,7 @@  -- | ----- prop> shrinkDoesNotShrinkToItselfOnValid shrinkValid+-- prop> shrinkDoesNotShrinkToItselfOnValid (shrinkValid ::  Rational -> [Rational]) shrinkDoesNotShrinkToItselfOnValid ::        forall a. (Show a, Eq a, GenValid a)     => (a -> [a])@@ -150,7 +149,7 @@  -- | ----- prop> shrinkDoesNotShrinkToItselfOnValidWithLimit shrinkValid 100+-- prop> shrinkDoesNotShrinkToItselfOnValidWithLimit (shrinkValid :: Rational -> [Rational]) 100 shrinkDoesNotShrinkToItselfOnValidWithLimit ::        forall a. (Show a, Eq a, GenValid a)     => (a -> [a])@@ -161,7 +160,7 @@  -- | ----- prop> shrinkDoesNotShrinkToItselfOnInvalid shrinkInvalid+-- prop> shrinkDoesNotShrinkToItselfOnInvalid (shrinkInvalid :: Rational -> [Rational]) shrinkDoesNotShrinkToItselfOnInvalid ::        forall a. (Show a, Eq a, GenInvalid a)     => (a -> [a])@@ -170,7 +169,7 @@  -- | ----- prop> shrinkDoesNotShrinkToItselfOnInvalidWithLimit shrinkInvalid 100+-- prop> shrinkDoesNotShrinkToItselfOnInvalidWithLimit (shrinkInvalid :: Rational -> [Rational]) 100 shrinkDoesNotShrinkToItselfOnInvalidWithLimit ::        forall a. (Show a, Eq a, GenInvalid a)     => (a -> [a])@@ -181,7 +180,7 @@  -- | ----- prop> doesNotShrinkToItself (pure 5) shrinkUnchecked+-- prop> doesNotShrinkToItself (pure 5 :: Gen Double) shrinkUnchecked doesNotShrinkToItself ::        forall a. (Show a, Eq a)     => Gen a@@ -191,7 +190,7 @@  -- | ----- prop> doesNotShrinkToItselfWithLimit (pure 5) shrinkUnchecked 100+-- prop> doesNotShrinkToItselfWithLimit (pure 5 :: Gen Double) shrinkUnchecked 100 doesNotShrinkToItselfWithLimit ::        forall a. (Show a, Eq a)     => Gen a