mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-20 23:51:36 +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
|