hakyll/tests/Hakyll/Web/Urls/Relativize/Tests.hs

21 lines
623 B
Haskell
Raw Normal View History

2011-02-09 18:57:25 +00:00
{-# LANGUAGE OverloadedStrings #-}
2011-09-06 20:26:07 +00:00
module Hakyll.Web.Urls.Relativize.Tests
2011-02-09 18:57:25 +00:00
( tests
) where
import Test.Framework
import Test.HUnit hiding (Test)
2011-09-06 20:26:07 +00:00
import Hakyll.Web.Urls.Relativize
2011-02-09 18:57:25 +00:00
import TestSuite.Util
tests :: [Test]
tests = fromAssertions "relativizeUrls"
[ "<a href=\"../foo\">bar</a>" @=?
relativizeUrls ".." "<a href=\"/foo\">bar</a>"
, "<img src=\"../../images/lolcat.png\"></img>" @=?
relativizeUrls "../.." "<img src=\"/images/lolcat.png\" />"
, "<a href=\"http://haskell.org\">Haskell</a>" @=?
relativizeUrls "../.." "<a href=\"http://haskell.org\">Haskell</a>"
]