genvalidity-hspec-binary 0.2.0.2 → 0.2.0.3
raw patch · 3 files changed
+21/−15 lines, 3 filesdep +genvalidity-propertydep +validitydep ~genvalidity
Dependencies added: genvalidity-property, validity
Dependency ranges changed: genvalidity
Files
- genvalidity-hspec-binary.cabal +17/−12
- src/Test/Validity/Binary.hs +2/−2
- test/Test/Validity/BinarySpec.hs +2/−1
genvalidity-hspec-binary.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: cc3b56a1e8ffc94c9f700f105668f0890c8c7a8148506385791917ad6aabf761+-- hash: 81d095183ba65cbf0bd41bfd8d830c76087f4a0e3edbe086fffefc3ab88d8e5f name: genvalidity-hspec-binary-version: 0.2.0.2+version: 0.2.0.3 synopsis: Standard spec's for binary-related Instances description: Standard spec's for cereal-related Instances, see https://hackage.haskell.org/package/binary. category: Testing@@ -27,6 +27,10 @@ location: https://github.com/NorfairKing/validity library+ exposed-modules:+ Test.Validity.Binary+ other-modules:+ Paths_genvalidity_hspec_binary hs-source-dirs: src/ ghc-options: -Wall@@ -38,39 +42,40 @@ , genvalidity >=0.5 , genvalidity-hspec >=0.6 , hspec- exposed-modules:- Test.Validity.Binary- other-modules:- Paths_genvalidity_hspec_binary default-language: Haskell2010 test-suite genvalidity-hspec-binary-doctests type: exitcode-stdio-1.0 main-is: DocTest.hs+ other-modules:+ Paths_genvalidity_hspec_binary hs-source-dirs: doctest ghc-options: -threaded build-depends: base , doctest+ , genvalidity >=0.7 , genvalidity-hspec-binary+ , genvalidity-property >=0.3 , hspec- other-modules:- Paths_genvalidity_hspec_binary+ , validity >=0.9 default-language: Haskell2010 test-suite genvalidity-hspec-binary-test type: exitcode-stdio-1.0 main-is: Spec.hs+ other-modules:+ Test.Validity.BinarySpec+ Paths_genvalidity_hspec_binary hs-source-dirs: test/ ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall build-depends: base- , genvalidity+ , genvalidity >=0.7 , genvalidity-hspec-binary+ , genvalidity-property >=0.3 , hspec- other-modules:- Test.Validity.BinarySpec- Paths_genvalidity_hspec_binary+ , validity >=0.9 default-language: Haskell2010
src/Test/Validity/Binary.hs view
@@ -29,7 +29,7 @@ -- -- Example usage: ----- > BinarySpecOnValid @Double+-- > BinarySpecOnValid @Rational binarySpecOnValid :: forall a. (Show a, Eq a, Typeable a, GenValid a, Binary a) => Spec@@ -115,7 +115,7 @@ encodeAndDecodeAreInversesOnGen gen s = forAllShrink gen s $ \(a :: a) -> case Binary.decodeOrFail (Binary.encode a) of- Right (_, _, b) -> a `shouldBe` b+ Right (_, _, b) -> b `shouldBe` a Left (_, _, s_) -> expectationFailure $ unwords ["decode of encode is not identity:", s_]
test/Test/Validity/BinarySpec.hs view
@@ -10,6 +10,7 @@ spec :: Spec spec = do binarySpecOnGen (genListOf $ pure 'a') "sequence of 'a's" (const [])- binarySpecOnValid @Double+ -- binarySpec @Double DOES NOT HOLD+ binarySpecOnValid @Rational binarySpec @Int binarySpecOnArbitrary @Int