mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-27 19:14:52 +03:00
16 lines
489 B
Haskell
16 lines
489 B
Haskell
module FilePath.ExtraTest where
|
|
|
|
import qualified FilePath.Extra as PE
|
|
import StrongPath (reldirP, toFilePath)
|
|
import Test.Tasty.Hspec
|
|
|
|
spec_reversePosixPath :: Spec
|
|
spec_reversePosixPath = do
|
|
[reldirP|.|] ~> "."
|
|
[reldirP|foo|] ~> ".."
|
|
[reldirP|foo/bar|] ~> "../.."
|
|
[reldirP|./foo/bar/./test|] ~> "../../.."
|
|
where
|
|
path ~> expectedReversedPath = it (show path ++ " -> " ++ expectedReversedPath) $ do
|
|
PE.reversePosixPath (toFilePath path) `shouldBe` expectedReversedPath
|