@@ -1,17 +1,23 @@
1+--------------------------------------------------------------------------------
1module Hakyll.Web.Urls.Tests
2module Hakyll.Web.Urls.Tests
5−import Data.Char (toUpper)
7+--------------------------------------------------------------------------------
8+import Data.Char (toUpper)
7−import Test.Framework
9+import Test.Framework (Test, testGroup)
8−import Test.HUnit hiding (Test)
10+import Test.HUnit (assert, (@=?))
10−import Hakyll.Web.Urls
13+--------------------------------------------------------------------------------
14+import Hakyll.Web.Urls
18+--------------------------------------------------------------------------------
13−tests :: [Test]
19+tests :: Test
14−tests = concat
20+tests = testGroup "Hakyll.Web.Urls.Tests" $ concat
15 [ fromAssertions "withUrls"
21 [ fromAssertions "withUrls"
16 [ "<a href=\"FOO\">bar</a>" @=?
22 [ "<a href=\"FOO\">bar</a>" @=?
17 withUrls (map toUpper) "<a href=\"foo\">bar</a>"
23 withUrls (map toUpper) "<a href=\"foo\">bar</a>"
@@ -26,17 +32,20 @@ tests = concat
26 , "<style>body > p { line-height: 1.3 }</style>" @=?
32 , "<style>body > p { line-height: 1.3 }</style>" @=?
27 withUrls id "<style>body > p { line-height: 1.3 }</style>"
33 withUrls id "<style>body > p { line-height: 1.3 }</style>"
29 , fromAssertions "toUrl"
36 , fromAssertions "toUrl"
30 [ "/foo/bar.html" @=? toUrl "foo/bar.html"
37 [ "/foo/bar.html" @=? toUrl "foo/bar.html"
31 , "/" @=? toUrl "/"
38 , "/" @=? toUrl "/"
32 , "/funny-pics.html" @=? toUrl "/funny-pics.html"
39 , "/funny-pics.html" @=? toUrl "/funny-pics.html"
34 , fromAssertions "toSiteRoot"
42 , fromAssertions "toSiteRoot"
35 [ ".." @=? toSiteRoot "/foo/bar.html"
43 [ ".." @=? toSiteRoot "/foo/bar.html"
36 , "." @=? toSiteRoot "index.html"
44 , "." @=? toSiteRoot "index.html"
37 , "." @=? toSiteRoot "/index.html"
45 , "." @=? toSiteRoot "/index.html"
38 , "../.." @=? toSiteRoot "foo/bar/qux"
46 , "../.." @=? toSiteRoot "foo/bar/qux"
40 , fromAssertions "isExternal"
49 , fromAssertions "isExternal"
41 [ assert (isExternal "http://reddit.com")
50 [ assert (isExternal "http://reddit.com")
42 , assert (isExternal "https://mail.google.com")
51 , assert (isExternal "https://mail.google.com")