hakyll/tests/Hakyll/Web/Util/Url/Tests.hs
2011-03-08 11:03:07 +01:00

25 lines
628 B
Haskell

module Hakyll.Web.Util.Url.Tests
( tests
) where
import Test.Framework
import Test.HUnit hiding (Test)
import Hakyll.Web.Util.Url
import TestSuite.Util
tests :: [Test]
tests = concat
[ fromAssertions "toUrl"
[ "/foo/bar.html" @=? toUrl "foo/bar.html"
, "/" @=? toUrl "/"
, "/funny-pics.html" @=? toUrl "/funny-pics.html"
]
, fromAssertions "toSiteRoot"
[ ".." @=? toSiteRoot "/foo/bar.html"
, "." @=? toSiteRoot "index.html"
, "." @=? toSiteRoot "/index.html"
, "../.." @=? toSiteRoot "foo/bar/qux"
]
]