summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Web/Urls/Relativize/Tests.hs
blob: 00f5a0f182adf41cb1b3d99086618bc3e53d1690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Web.Urls.Relativize.Tests
    ( tests
    ) where

import Test.Framework
import Test.HUnit hiding (Test)

import Hakyll.Web.Urls.Relativize
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>"
    ]