genvalidity-hspec 0.6.2.2 → 0.6.2.3
raw patch · 3 files changed
+29/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- genvalidity-hspec.cabal +2/−2
- src/Test/Validity.hs +19/−5
- src/Test/Validity/GenValidity.hs +8/−0
genvalidity-hspec.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 8fbfbbf0a57f41dc695ffc641841eb79c999ac4f6a0c4c86e81f50422b34e23f+-- hash: c9a9df67c4e4398907c737952eee38ffde3bda054a6a13747c77f10e12a64565 name: genvalidity-hspec-version: 0.6.2.2+version: 0.6.2.3 synopsis: Standard spec's for GenValidity instances description: Note: There are companion packages for this library: .
src/Test/Validity.hs view
@@ -2,16 +2,25 @@ {-# LANGUAGE ScopedTypeVariables #-} -- | To use the 'Spec' functions in this module, you will need @TypeApplications@.+--+--+-- The most interesting functions in this module for most uses are:+--+-- * 'genValidSpec'+-- * 'eqSpecOnValid'+-- * 'ordSpecOnValid'+-- * 'producesValidsOnValids'+-- * 'forAllValid'+-- * 'shouldBeValid' module Test.Validity- ( module Data.GenValidity- , forAllUnchecked+ ( -- * Writing properties+ -- ** Cheap generation with shrinking+ forAllUnchecked , forAllValid , forAllInvalid+ -- ** Cheap assertions , shouldBeValid , shouldBeInvalid- -- * Tests for Arbitrary instances involving Validity- , arbitrarySpec- , arbitraryGeneratesOnlyValid -- * Tests for GenValidity instances , genValiditySpec , genValidSpec@@ -33,6 +42,9 @@ , shrinkingStaysValid , shrinkingStaysInvalid , shrinkingPreserves+ -- * Tests for Arbitrary instances involving Validity+ , arbitrarySpec+ , arbitraryGeneratesOnlyValid -- * Tests for RelativeValidity instances , relativeValiditySpec , relativeValidityImpliesValidA@@ -253,6 +265,8 @@ , monadSpec , monadSpecOnArbitrary , monadSpecOnGens+ -- * Re-exports+ , module Data.GenValidity ) where import Data.GenValidity
src/Test/Validity/GenValidity.hs view
@@ -31,6 +31,9 @@ -- 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)__+-- In that case you probably want 'genValidSpec'.+-- -- Example usage: -- -- > genValiditySpec @Int@@ -43,6 +46,9 @@ -- | A @Spec@ that specifies that @genValid@ only generates valid data. --+-- In general it is a good idea to add this spec to your test suite if you+-- write a custom implementation of @genValid@.+-- -- Example usage: -- -- > genValidSpec @Int@@ -58,6 +64,8 @@ forAllShrink genValid shrinkValid $ shouldBeValid @a -- | 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) -- -- Example usage: --