diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-09 19:57:25 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-09 19:57:25 +0100 |
commit | 8cec091e04e9bf1fa8cad01056d1c9cbed4fa44f (patch) | |
tree | 3f783078f1a0f28d71b9e738d6c3bf32c57827ab /tests/Hakyll/Web/RelativizeUrls | |
parent | d9e0c3e86b03834a03e7ddf37b70cc141eccfe1c (diff) | |
download | hakyll-8cec091e04e9bf1fa8cad01056d1c9cbed4fa44f.tar.gz |
Add some tests for RelativizeUrls
Diffstat (limited to 'tests/Hakyll/Web/RelativizeUrls')
-rw-r--r-- | tests/Hakyll/Web/RelativizeUrls/Tests.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/Hakyll/Web/RelativizeUrls/Tests.hs b/tests/Hakyll/Web/RelativizeUrls/Tests.hs new file mode 100644 index 0000000..033c5fd --- /dev/null +++ b/tests/Hakyll/Web/RelativizeUrls/Tests.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE OverloadedStrings #-} +module Hakyll.Web.RelativizeUrls.Tests + ( tests + ) where + +import Test.Framework +import Test.Framework.Providers.HUnit +import Test.HUnit hiding (Test) + +import Hakyll.Web.RelativizeUrls +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>" + ] |