Julian Ospald
3e6d93182a
We don't expect "Path Abs" everywhere anymore. The functions have been made to be more generic. A user can still pass absolute paths, so we don't lose any safety. However, some function implementations may be more tricky.
28 lines
465 B
Haskell
28 lines
465 B
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
|
|
module HPath.IO.ToAbsSpec where
|
|
|
|
|
|
import Test.Hspec
|
|
import HPath
|
|
import HPath.IO
|
|
|
|
|
|
|
|
spec :: Spec
|
|
spec = describe "HPath.IO.toAbs" $ do
|
|
|
|
-- successes --
|
|
it "toAbs returns absolute paths unchanged" $ do
|
|
p1 <- parseAbs "/a/b/c/d"
|
|
to <- toAbs p1
|
|
p1 `shouldBe` to
|
|
|
|
it "toAbs returns even existing absolute paths unchanged" $ do
|
|
p1 <- parseAbs "/home"
|
|
to <- toAbs p1
|
|
p1 `shouldBe` to
|
|
|
|
|