elm-pages-v3-beta/tests/PathTests.elm
2021-05-23 10:03:21 -07:00

26 lines
750 B
Elm

module PathTests exposing (all)
import Expect
import Path
import Test exposing (describe, test)
all =
describe "Path"
[ test "join two segments" <|
\() ->
Path.join [ "a", "b", "c" ]
|> Path.toAbsolute
|> Expect.equal "/a/b/c"
, test "join segments that have paths in them" <|
\() ->
Path.join [ "a", "b", "c/d/e" ]
|> Path.toAbsolute
|> Expect.equal "/a/b/c/d/e"
, test "removes trailing and leading slashes" <|
\() ->
Path.join [ "a/", "/b/", "/c/d/e/" ]
|> Path.toAbsolute
|> Expect.equal "/a/b/c/d/e"
]