Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5613ba1dfa | ||
|
|
07aa83ca19 | ||
|
|
a68b46b060 |
@@ -1,5 +1,5 @@
|
|||||||
name: path
|
name: path
|
||||||
version: 0.2.0
|
version: 0.3.0
|
||||||
synopsis: Path
|
synopsis: Path
|
||||||
description: Path
|
description: Path
|
||||||
license: BSD3
|
license: BSD3
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ module Path.Internal
|
|||||||
where
|
where
|
||||||
|
|
||||||
import Data.Data
|
import Data.Data
|
||||||
import GHC.Generics
|
|
||||||
|
|
||||||
-- | Path of some base and type.
|
-- | Path of some base and type.
|
||||||
--
|
--
|
||||||
@@ -22,7 +21,7 @@ import GHC.Generics
|
|||||||
-- All directories end in a trailing separator. There are no duplicate
|
-- All directories end in a trailing separator. There are no duplicate
|
||||||
-- path separators @\/\/@, no @..@, no @.\/@, no @~\/@, etc.
|
-- path separators @\/\/@, no @..@, no @.\/@, no @~\/@, etc.
|
||||||
newtype Path b t = Path FilePath
|
newtype Path b t = Path FilePath
|
||||||
deriving (Typeable,Generic)
|
deriving (Typeable)
|
||||||
|
|
||||||
-- | String equality.
|
-- | String equality.
|
||||||
--
|
--
|
||||||
|
|||||||
10
test/Main.hs
10
test/Main.hs
@@ -23,7 +23,7 @@ spec =
|
|||||||
describe "Operations: (</>)" operationAppend
|
describe "Operations: (</>)" operationAppend
|
||||||
describe "Operations: stripDir" operationStripDir
|
describe "Operations: stripDir" operationStripDir
|
||||||
describe "Operations: isParentOf" operationIsParentOf
|
describe "Operations: isParentOf" operationIsParentOf
|
||||||
describe "Operations: parentAbs" operationParentAbs
|
describe "Operations: parent" operationParent
|
||||||
describe "Operations: filename" operationFilename
|
describe "Operations: filename" operationFilename
|
||||||
|
|
||||||
-- | The 'filename' operation.
|
-- | The 'filename' operation.
|
||||||
@@ -38,10 +38,10 @@ operationFilename =
|
|||||||
filename $(mkRelFile "bar.txt")) ==
|
filename $(mkRelFile "bar.txt")) ==
|
||||||
$(mkRelFile "bar.txt"))
|
$(mkRelFile "bar.txt"))
|
||||||
|
|
||||||
-- | The 'parentAbs' operation.
|
-- | The 'parent' operation.
|
||||||
operationParentAbs :: Spec
|
operationParent :: Spec
|
||||||
operationParentAbs =
|
operationParent =
|
||||||
do it "parentAbs (parent </> child) == parent"
|
do it "parent (parent </> child) == parent"
|
||||||
(parent ($(mkAbsDir "/foo") </>
|
(parent ($(mkAbsDir "/foo") </>
|
||||||
$(mkRelDir "bar")) ==
|
$(mkRelDir "bar")) ==
|
||||||
$(mkAbsDir "/foo"))
|
$(mkAbsDir "/foo"))
|
||||||
|
|||||||
Reference in New Issue
Block a user