From cf71e295467aa75606d491627541610e17dd1c64 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 8 Mar 2011 11:03:07 +0100 Subject: Make toSiteRoot work with /xxx URL's --- tests/Hakyll/Web/Util/Url/Tests.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/Hakyll/Web/Util/Url/Tests.hs (limited to 'tests/Hakyll/Web/Util') diff --git a/tests/Hakyll/Web/Util/Url/Tests.hs b/tests/Hakyll/Web/Util/Url/Tests.hs new file mode 100644 index 0000000..aab4172 --- /dev/null +++ b/tests/Hakyll/Web/Util/Url/Tests.hs @@ -0,0 +1,25 @@ +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" + ] + ] -- cgit v1.2.3