data-validation 0.1.2.2 → 0.1.2.4
raw patch · 3 files changed
+40/−14 lines, 3 files
Files
- CHANGELOG.md +9/−0
- data-validation.cabal +8/−14
- test/Data/ExampleSpec.hs +23/−0
CHANGELOG.md view
@@ -1,5 +1,14 @@ # Revision history for data-validation +## 0.1.2.4 -- 2020-12-17 + +* Removed example executable build. +* Added example tests to test-suite. + +## 0.1.2.3 -- 2020-12-16 + +* Changed example to executable build. + ## 0.1.2.2 -- 2020-12-16 * Minor fix to cabal file.
data-validation.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: data-validation -version: 0.1.2.2 +version: 0.1.2.4 synopsis: A library for creating type safe validations. description: A library for creating type safe validations using typeclasses. @@ -16,7 +16,7 @@ source-repository head type: git location: https://github.com/alasconnect/data-validation - tag: 0.1.2.2 + tag: 0.1.2.4 library exposed-modules: Data.Validation @@ -29,27 +29,21 @@ default-language: Haskell2010 ghc-options: -Wall -v0 -library examples - if !(impl(ghcjs)) - exposed-modules: Examples.Data.ComplexTypes - , Examples.Data.Primitives - build-depends: base >= 4.11.0.1 && < 5 - , data-validation - , regex-tdfa - hs-source-dirs: examples - default-language: Haskell2010 - ghc-options: -Wall -v0 - test-suite test-data-validation type: exitcode-stdio-1.0 main-is: Spec.hs other-modules: Data.ValidationSpec , Data.Validation.InternalSpec - hs-source-dirs: test + -- example tests + , Data.ExampleSpec + , Examples.Data.ComplexTypes + , Examples.Data.Primitives + hs-source-dirs: test, examples build-depends: base , containers , data-validation , hspec + , regex-tdfa , template-haskell default-language: Haskell2010 ghc-options: -threaded -Wall
+ test/Data/ExampleSpec.hs view
@@ -0,0 +1,23 @@+module Data.ExampleSpec where++------------------------------------------------------------------------------------------------------------------------+import Prelude+import Data.Validation+import Test.Hspec+------------------------------------------------------------------------------------------------------------------------+import Examples.Data.ComplexTypes+import Examples.Data.Primitives+------------------------------------------------------------------------------------------------------------------------++spec :: Spec+spec = parallel $ do++ describe "Example ComplexTypes Validation" $ do+ it "Valid UserVM produces valid Proof" $ do+ let validForm = UserVM (Just "Hugh Mann") (Just "person@earth.com") Nothing (Just Email) Nothing+ userProof = validate validForm+ userProof `shouldSatisfy` isValid+ it "Invalid UserVM produces invalid Proof" $ do+ let invalidForm = UserVM (Just "broken") Nothing (Just "123") (Just Email) Nothing+ userFailure = validate invalidForm+ userFailure `shouldSatisfy` isInvalid