packages feed

genvalidity 0.4.0.2 → 0.4.0.3

raw patch · 3 files changed

+74/−65 lines, 3 filesdep ~QuickCheck

Dependency ranges changed: QuickCheck

Files

genvalidity.cabal view
@@ -1,67 +1,76 @@-name: genvalidity-version: 0.4.0.2-cabal-version: >=1.10-build-type: Simple-license: MIT-license-file: LICENSE-copyright: Copyright: (c) 2016 Tom Sydney Kerckhove-maintainer: syd.kerckhove@gmail.com-homepage: https://github.com/NorfairKing/validity#readme-synopsis: Testing utilities for the validity library-description:-    Note: There are companion instance packages for this library:-    .-    * <https://hackage.haskell.org/package/genvalidity-aeson genvalidity-aeson>-    .-    * <https://hackage.haskell.org/package/genvalidity-bytestring genvalidity-bytestring>-    .-    * <https://hackage.haskell.org/package/genvalidity-containers genvalidity-containers>-    .-    * <https://hackage.haskell.org/package/genvalidity-path genvalidity-path>-    .-    * <https://hackage.haskell.org/package/genvalidity-scientific genvalidity-scientific>-    .-    * <https://hackage.haskell.org/package/genvalidity-text genvalidity-text>-    .-    * <https://hackage.haskell.org/package/genvalidity-time genvalidity-time>-    .-    * <https://hackage.haskell.org/package/genvalidity-unordered-containers genvalidity-unordered-containers>-    .-    * <https://hackage.haskell.org/package/genvalidity-uuid genvalidity-uuid>-    .-    * <https://hackage.haskell.org/package/genvalidity-vector genvalidity-vector>-    .-category: Testing-author: Tom Sydney Kerckhove+-- This file has been generated from package.yaml by hpack version 0.20.0.+--+-- see: https://github.com/sol/hpack+--+-- hash: f7a4a4bfcf7f082293595e4f68b4be5e4a0241a36104439b6872b3b759bd0c9c +name:           genvalidity+version:        0.4.0.3+synopsis:       Testing utilities for the validity library+description:    Note: There are companion instance packages for this library:+                .+                * <https://hackage.haskell.org/package/genvalidity-aeson genvalidity-aeson>+                .+                * <https://hackage.haskell.org/package/genvalidity-bytestring genvalidity-bytestring>+                .+                * <https://hackage.haskell.org/package/genvalidity-containers genvalidity-containers>+                .+                * <https://hackage.haskell.org/package/genvalidity-path genvalidity-path>+                .+                * <https://hackage.haskell.org/package/genvalidity-scientific genvalidity-scientific>+                .+                * <https://hackage.haskell.org/package/genvalidity-text genvalidity-text>+                .+                * <https://hackage.haskell.org/package/genvalidity-time genvalidity-time>+                .+                * <https://hackage.haskell.org/package/genvalidity-unordered-containers genvalidity-unordered-containers>+                .+                * <https://hackage.haskell.org/package/genvalidity-uuid genvalidity-uuid>+                .+                * <https://hackage.haskell.org/package/genvalidity-vector genvalidity-vector>+category:       Testing+homepage:       https://github.com/NorfairKing/validity#readme+bug-reports:    https://github.com/NorfairKing/validity/issues+author:         Tom Sydney Kerckhove+maintainer:     syd.kerckhove@gmail.com+copyright:      Copyright: (c) 2016 Tom Sydney Kerckhove+license:        MIT+license-file:   LICENSE+build-type:     Simple+cabal-version:  >= 1.10+ source-repository head-    type: git-    location: https://github.com/NorfairKing/validity+  type: git+  location: https://github.com/NorfairKing/validity  library-    -    if impl(ghc >=8.0.0)-        ghc-options: -Wno-redundant-constraints-    exposed-modules:-        Data.GenValidity-        Data.GenRelativeValidity-    build-depends:-        base >=4.7 && <5,-        validity >=0.4.0.2 && <0.5,-        QuickCheck >=2.7 && <2.11-    default-language: Haskell2010-    hs-source-dirs: src+  hs-source-dirs:+      src+  build-depends:+      QuickCheck >=2.7 && <2.12+    , base >=4.7 && <5+    , validity >=0.4.0.2 && <0.5+  if impl(ghc >=8.0.0)+    ghc-options: -Wno-redundant-constraints+  exposed-modules:+      Data.GenValidity+      Data.GenRelativeValidity+  other-modules:+      Paths_genvalidity+  default-language: Haskell2010  test-suite genvalidity-test-    type: exitcode-stdio-1.0-    main-is: Spec.hs-    build-depends:-        base -any,-        hspec -any,-        QuickCheck -any,-        genvalidity -any-    default-language: Haskell2010-    hs-source-dirs: test-    other-modules:-        Data.GenValiditySpec-    ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -fno-warn-name-shadowing+  type: exitcode-stdio-1.0+  main-is: Spec.hs+  hs-source-dirs:+      test+  ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -fno-warn-name-shadowing+  build-depends:+      QuickCheck+    , base+    , genvalidity+    , hspec+  other-modules:+      Data.GenValiditySpec+      Paths_genvalidity+  default-language: Haskell2010
src/Data/GenValidity.hs view
@@ -411,14 +411,14 @@  instance GenValid Integer -instance GenUnchecked (Ratio Integer) where+instance (Integral a, GenUnchecked a) => GenUnchecked (Ratio a) where     genUnchecked = do         n <- genUnchecked         d <- genUnchecked         pure $ n :% d-    shrinkUnchecked = shrink+    shrinkUnchecked (n :% d) = [n' :% d' | (n', d') <- shrinkUnchecked (n, d)] -instance GenValid (Ratio Integer)+instance (Integral a, Num a, Ord a, GenValid a) => GenValid (Ratio a)  instance HasResolution a => GenUnchecked (Fixed a) where     genUnchecked = MkFixed <$> genUnchecked
test/Data/GenValiditySpec.hs view
@@ -11,7 +11,7 @@ spec = do     describe "upTo" $         it "returns only positive integers" $-            forAll arbitrary $ \n -> forAll (upTo n) (`shouldSatisfy` (>= 0))+        forAll arbitrary $ \n -> forAll (upTo n) (`shouldSatisfy` (>= 0))     describe "genSplit" $ do         it "returns positive integers" $             forAll arbitrary $ \i ->