@@ -1,25 +1,35 @@
1+--------------------------------------------------------------------------------
12{-# LANGUAGE OverloadedStrings #-}
23module Hakyll.Web.Urls.Relativize.Tests
34 ( tests
45 ) where
56
6−import Test.Framework
7−import Test.HUnit hiding (Test)
87
9−import Hakyll.Web.Urls.Relativize
10−import TestSuite.Util
8+--------------------------------------------------------------------------------
9+import Test.Framework (Test, testGroup)
10+import Test.HUnit ((@=?))
1111
12−tests :: [Test]
13−tests = fromAssertions "relativizeUrls"
14− [ "<a href=\"../foo\">bar</a>" @=?
15− relativizeUrls ".." "<a href=\"/foo\">bar</a>"
16− , "<img src=\"../../images/lolcat.png\"></img>" @=?
17− relativizeUrls "../.." "<img src=\"/images/lolcat.png\" />"
18− , "<a href=\"http://haskell.org\">Haskell</a>" @=?
19− relativizeUrls "../.." "<a href=\"http://haskell.org\">Haskell</a>"
20− , "<a href=\"http://haskell.org\">Haskell</a>" @=?
21− relativizeUrls "../.." "<a href=\"http://haskell.org\">Haskell</a>"
22− , "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>" @=?
23− relativizeUrls "../.."
24− "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>"
25− ]
12+
13+--------------------------------------------------------------------------------
14+import Hakyll.Web.Urls.Relativize
15+import TestSuite.Util
16+
17+
18+--------------------------------------------------------------------------------
19+tests :: Test
20+tests = testGroup "Hakyll.Web.Urls.Relativize.Tests" $
21+ fromAssertions "relativizeUrls"
22+ [ "<a href=\"../foo\">bar</a>" @=?
23+ relativizeUrlsWith ".." "<a href=\"/foo\">bar</a>"
24+ , "<img src=\"../../images/lolcat.png\"></img>" @=?
25+ relativizeUrlsWith "../.." "<img src=\"/images/lolcat.png\" />"
26+ , "<a href=\"http://haskell.org\">Haskell</a>" @=?
27+ relativizeUrlsWith "../.."
28+ "<a href=\"http://haskell.org\">Haskell</a>"
29+ , "<a href=\"http://haskell.org\">Haskell</a>" @=?
30+ relativizeUrlsWith "../.."
31+ "<a href=\"http://haskell.org\">Haskell</a>"
32+ , "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>" @=?
33+ relativizeUrlsWith "../.."
34+ "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>"
35+ ]