diff options
| author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-12-25 22:49:17 +0100 |
|---|---|---|
| committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-12-25 22:49:29 +0100 |
| commit | 69ffbe03563cdbc7be6b826e2def2fc797442792 (patch) | |
| tree | 3792ce42ee2e9983876f9177533201dd712b76d1 /tests/Hakyll/Web/Urls | |
| parent | 2ae11c9d7f3138fe9e8397059c641e1962ede197 (diff) | |
| download | hakyll-69ffbe03563cdbc7be6b826e2def2fc797442792.tar.gz | |
Add demoteHeaders, refactor a bit
Diffstat (limited to 'tests/Hakyll/Web/Urls')
| -rw-r--r-- | tests/Hakyll/Web/Urls/Relativize/Tests.hs | 34 | ||||
| -rw-r--r-- | tests/Hakyll/Web/Urls/Tests.hs | 55 |
2 files changed, 0 insertions, 89 deletions
diff --git a/tests/Hakyll/Web/Urls/Relativize/Tests.hs b/tests/Hakyll/Web/Urls/Relativize/Tests.hs deleted file mode 100644 index 802a1ca..0000000 --- a/tests/Hakyll/Web/Urls/Relativize/Tests.hs +++ /dev/null @@ -1,34 +0,0 @@ --------------------------------------------------------------------------------- -{-# LANGUAGE OverloadedStrings #-} -module Hakyll.Web.Urls.Relativize.Tests - ( tests - ) where - - --------------------------------------------------------------------------------- -import Test.Framework (Test, testGroup) -import Test.HUnit ((@=?)) - --------------------------------------------------------------------------------- -import Hakyll.Web.Urls.Relativize -import TestSuite.Util - - --------------------------------------------------------------------------------- -tests :: Test -tests = testGroup "Hakyll.Web.Urls.Relativize.Tests" $ - fromAssertions "relativizeUrls" - [ "<a href=\"../foo\">bar</a>" @=? - relativizeUrlsWith ".." "<a href=\"/foo\">bar</a>" - , "<img src=\"../../images/lolcat.png\" />" @=? - relativizeUrlsWith "../.." "<img src=\"/images/lolcat.png\" />" - , "<a href=\"http://haskell.org\">Haskell</a>" @=? - relativizeUrlsWith "../.." - "<a href=\"http://haskell.org\">Haskell</a>" - , "<a href=\"http://haskell.org\">Haskell</a>" @=? - relativizeUrlsWith "../.." - "<a href=\"http://haskell.org\">Haskell</a>" - , "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>" @=? - relativizeUrlsWith "../.." - "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>" - ] diff --git a/tests/Hakyll/Web/Urls/Tests.hs b/tests/Hakyll/Web/Urls/Tests.hs deleted file mode 100644 index 648f308..0000000 --- a/tests/Hakyll/Web/Urls/Tests.hs +++ /dev/null @@ -1,55 +0,0 @@ --------------------------------------------------------------------------------- -module Hakyll.Web.Urls.Tests - ( tests - ) where - - --------------------------------------------------------------------------------- -import Data.Char (toUpper) -import Test.Framework (Test, testGroup) -import Test.HUnit (assert, (@=?)) - - --------------------------------------------------------------------------------- -import Hakyll.Web.Urls -import TestSuite.Util - - --------------------------------------------------------------------------------- -tests :: Test -tests = testGroup "Hakyll.Web.Urls.Tests" $ concat - [ fromAssertions "withUrls" - [ "<a href=\"FOO\">bar</a>" @=? - withUrls (map toUpper) "<a href=\"foo\">bar</a>" - , "<img src=\"OH BAR\" />" @=? - withUrls (map toUpper) "<img src=\"oh bar\" />" - - -- Test escaping - , "<script>\"sup\"</script>" @=? - withUrls id "<script>\"sup\"</script>" - , "<code><stdio></code>" @=? - withUrls id "<code><stdio></code>" - , "<style>body > p { line-height: 1.3 }</style>" @=? - withUrls id "<style>body > p { line-height: 1.3 }</style>" - ] - - , fromAssertions "toUrl" - [ "/foo/bar.html" @=? toUrl "foo/bar.html" - , "/" @=? toUrl "/" - , "/funny-pics.html" @=? toUrl "/funny-pics.html" - ] - - , fromAssertions "toSiteRoot" - [ ".." @=? toSiteRoot "/foo/bar.html" - , "." @=? toSiteRoot "index.html" - , "." @=? toSiteRoot "/index.html" - , "../.." @=? toSiteRoot "foo/bar/qux" - ] - - , fromAssertions "isExternal" - [ assert (isExternal "http://reddit.com") - , assert (isExternal "https://mail.google.com") - , assert (not (isExternal "../header.png")) - , assert (not (isExternal "/foo/index.html")) - ] - ] |
