diff --git a/lts-2.yaml b/lts-2.yaml index bff7f4c..e8fa0b9 100644 --- a/lts-2.yaml +++ b/lts-2.yaml @@ -1 +1,6 @@ +extra-deps: +- genvalidity-0.3.2.0 +- genvalidity-property-0.0.0.0 +- validity-0.3.3.0 resolver: lts-2.22 + diff --git a/lts-6.yaml b/lts-6.yaml index 87f4d2e..688e753 100644 --- a/lts-6.yaml +++ b/lts-6.yaml @@ -1 +1,5 @@ +extra-deps: +- genvalidity-0.3.2.0 +- genvalidity-property-0.0.0.0 +- validity-0.3.3.0 resolver: lts-6.30 diff --git a/path.cabal b/path.cabal index 8c13359..bd2570c 100644 --- a/path.cabal +++ b/path.cabal @@ -12,11 +12,6 @@ build-type: Simple cabal-version: >=1.10 extra-source-files: README.md, CHANGELOG -flag validity - manual: True - default: False - description: Enable validity tests. - library hs-source-dirs: src ghc-options: -Wall -O2 @@ -46,20 +41,17 @@ test-suite test default-language: Haskell2010 test-suite validity-test - if !flag(validity) - buildable: False type: exitcode-stdio-1.0 main-is: ValidityTest.hs other-modules: Path.Gen hs-source-dirs: test - if flag(validity) - build-depends: QuickCheck + build-depends: QuickCheck , aeson - , base >= 4.9 && < 5 + , base >= 4.7 && < 5 , bytestring , filepath < 1.2.0.1 || >= 1.3 , genvalidity >= 0.3 && < 0.4 - , genvalidity-hspec >= 0.3 && < 0.4 + , genvalidity-property >= 0.0 && < 0.1 , hspec >= 2.0 && < 3 , mtl >= 2.0 && < 3 , path diff --git a/stack.yaml b/stack.yaml index 346e42c..6635304 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,8 +1,5 @@ -flags: - path: - validity: true extra-deps: -- genvalidity-0.3.1.0 -- genvalidity-hspec-0.3.1.0 -- validity-0.3.2.0 +- genvalidity-0.3.2.0 +- genvalidity-property-0.0.0.0 +- validity-0.3.3.0 resolver: lts-8.3 diff --git a/test/Path/Gen.hs b/test/Path/Gen.hs index dee638b..af64862 100644 --- a/test/Path/Gen.hs +++ b/test/Path/Gen.hs @@ -1,6 +1,9 @@ {-# LANGUAGE FlexibleInstances #-} module Path.Gen where +import Data.Functor +import Prelude + import Path import Path.Internal diff --git a/test/ValidityTest.hs b/test/ValidityTest.hs index 4b25427..36169fa 100644 --- a/test/ValidityTest.hs +++ b/test/ValidityTest.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -15,7 +14,7 @@ import Path import Path.Internal import Test.Hspec import Test.QuickCheck -import Test.Validity +import Test.Validity.Property import Path.Gen @@ -50,19 +49,19 @@ operationFilename = do filename (parent file) `shouldBe` filename file it "produces a valid path on when passed a valid absolute path" $ do - producesValidsOnValids (filename @Abs) + producesValidsOnValids (filename :: Path Abs File -> Path Rel File) it "produces a valid path on when passed a valid relative path" $ do - producesValidsOnValids (filename @Rel) + producesValidsOnValids (filename :: Path Rel File -> Path Rel File) -- | The 'parent' operation. operationParent :: Spec operationParent = do it "produces a valid path on when passed a valid file path" $ do - producesValidsOnValids (parent @File) + producesValidsOnValids (parent :: Path Abs File -> Path Abs Dir) it "produces a valid path on when passed a valid directory path" $ do - producesValidsOnValids (parent @Dir) + producesValidsOnValids (parent :: Path Abs Dir -> Path Abs Dir) -- | The 'isParentOf' operation. operationIsParentOf :: Spec @@ -111,31 +110,31 @@ operationStripDir = do stripDir parent (parent child) == Just child it "produces a valid path on when passed a valid absolute file paths" $ do - producesValidsOnValids2 (stripDir @Maybe @Abs @File) + producesValidsOnValids2 (stripDir :: Path Abs Dir -> Path Abs File -> Maybe (Path Rel File)) it "produces a valid path on when passed a valid absolute directory paths" $ do - producesValidsOnValids2 (stripDir @Maybe @Abs @Dir) + producesValidsOnValids2 (stripDir :: Path Abs Dir -> Path Abs Dir -> Maybe (Path Rel Dir)) it "produces a valid path on when passed a valid relative file paths" $ do - producesValidsOnValids2 (stripDir @Maybe @Rel @File) + producesValidsOnValids2 (stripDir :: Path Rel Dir -> Path Rel File-> Maybe (Path Rel File)) it "produces a valid path on when passed a valid relative directory paths" $ do - producesValidsOnValids2 (stripDir @Maybe @Rel @Dir) + producesValidsOnValids2 (stripDir :: Path Rel Dir -> Path Rel Dir -> Maybe (Path Rel Dir)) -- | The '' operation. operationAppend :: Spec operationAppend = do it "produces a valid path on when creating valid absolute file paths" $ do - producesValidsOnValids2 (() @Abs @File) + producesValidsOnValids2 (() :: Path Abs Dir -> Path Rel File -> Path Abs File) it "produces a valid path on when creating valid absolute directory paths" $ do - producesValidsOnValids2 (() @Abs @Dir) + producesValidsOnValids2 (() :: Path Abs Dir -> Path Rel Dir -> Path Abs Dir) it "produces a valid path on when creating valid relative file paths" $ do - producesValidsOnValids2 (() @Rel @File) + producesValidsOnValids2 (() :: Path Rel Dir -> Path Rel File -> Path Rel File) it "produces a valid path on when creating valid relative directory paths" $ do - producesValidsOnValids2 (() @Rel @Dir) + producesValidsOnValids2 (() :: Path Rel Dir -> Path Rel Dir -> Path Rel Dir) parserSpec :: (Show p, Validity p) => (FilePath -> Maybe p) -> Spec parserSpec parser =