hspecVariant 1.0.0.0 → 1.0.1.0
raw patch · 4 files changed
+41/−5 lines, 4 filesdep +QuickCheckdep +hspecVariantdep ~QuickCheckVariantPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: QuickCheck, hspecVariant
Dependency ranges changed: QuickCheckVariant
API changes (from Hackage documentation)
- Test.Hspec.Variant: propInvalid :: (VarTestable prop) => String -> prop -> Spec
+ Test.Hspec.Variant: propInvalid :: VarTestable prop => String -> prop -> Spec
- Test.Hspec.Variant: propValid :: (VarTestable prop) => String -> prop -> Spec
+ Test.Hspec.Variant: propValid :: VarTestable prop => String -> prop -> Spec
Files
- README.md +3/−1
- hspecVariant.cabal +16/−3
- src/Test/Hspec/Variant.hs +1/−1
- test/VariantTest.hs +21/−0
README.md view
@@ -2,7 +2,8 @@ Spec for testing properties for variant types -[](https://hackage.haskell.org/package/hspecVariant)+[](https://hackage.haskell.org/package/hspecVariant)+[](https://gitlab.com/sanjorgek/hspecVariant/commits/master) ```haskell {-# LANGUAGE TypeSynonymInstances #-}@@ -22,6 +23,7 @@ Test ```haskell+import Test.QuickCheck import Test.Hspec import Test.Hspec.Variant
hspecVariant.cabal view
@@ -2,8 +2,8 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 1.0.0.0-synopsis: Spec for testing properties for variant types+version: 1.0.1.0+synopsis: Spec for testing properties description: Spec for testing properties for variant types. Uses QuickCheckVariant package. homepage: https://github.com/sanjorgek/hspecVariant@@ -27,7 +27,20 @@ -- other-modules: -- other-extensions: build-depends: base >=4.6 && <5- , QuickCheckVariant >=1 && <2+ , QuickCheckVariant >=1.0.1.0 && <2 , hspec >=2.2 && <3 hs-source-dirs: src default-language: Haskell98++test-suite variant+ type: exitcode-stdio-1.0+ hs-source-dirs: test+ main-is: VariantTest.hs+ --other-modules:+ build-depends: base >=4.6 && <5+ , QuickCheckVariant >=1.0.1.0 && <2+ , QuickCheck >=2.12 && <2.15+ , hspec >=2.2 && <3+ , hspecVariant+ default-language: Haskell2010+
src/Test/Hspec/Variant.hs view
@@ -1,7 +1,7 @@ {-# OPTIONS_GHC -fno-warn-tabs #-} {-| Module : Test.Hspec.Variant-Description : Varaint property spec+Description : Variant property spec Copyright : (c) Jorge Santiago Alvarez Cuadros, 2015 License : GPL-3 Maintainer : sanjorgek@ciencias.unam.mx
+ test/VariantTest.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE TypeSynonymInstances #-}+import Test.QuickCheck+import Test.QuickCheck.Variant+import Test.Hspec+import Test.Hspec.Variant++type Natural = Integer++instance Variant Natural where+ invalid = do+ n <- arbitrary+ if (n<0) then return n else return ((-1)*(n+1))+ valid = do+ n <- arbitrary+ if (n>=0) then return n else return ((-1)*n)++main::IO ()+main = hspec $+ describe "Naturals" $+ propValid "succ" $+ \x -> succ (x::Natural) > 0