summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2013-06-16 14:39:55 +0300
committerSimonas Kazlauskas <git@kazlauskas.me>2013-06-16 14:57:31 +0300
commitd456f6ebf724fc83b7c23fa9625b0b484acc1f00 (patch)
tree9615b036b7518b8ced9c50351b7970dcd8d56494 /tests
parent537e72333f8deafa59219b60dcae0a4f52569317 (diff)
downloadhakyll-d456f6ebf724fc83b7c23fa9625b0b484acc1f00.tar.gz
More tests for toUrl function
Diffstat (limited to 'tests')
-rw-r--r--tests/Hakyll/Web/Html/Tests.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/Hakyll/Web/Html/Tests.hs b/tests/Hakyll/Web/Html/Tests.hs
index a33823c..e150ea2 100644
--- a/tests/Hakyll/Web/Html/Tests.hs
+++ b/tests/Hakyll/Web/Html/Tests.hs
@@ -43,10 +43,15 @@ tests = testGroup "Hakyll.Web.Html.Tests" $ concat
]
, fromAssertions "toUrl"
- [ "/foo/bar.html" @=? toUrl "foo/bar.html"
- , "/" @=? toUrl "/"
- , "/funny-pics.html" @=? toUrl "/funny-pics.html"
- , "/funny%20pics.html" @=? toUrl "funny pics.html"
+ [ "/foo/bar.html" @=? toUrl "foo/bar.html"
+ , "/" @=? toUrl "/"
+ , "/funny-pics.html" @=? toUrl "/funny-pics.html"
+ , "/funny%20pics.html" @=? toUrl "funny pics.html"
+ -- Test various reserved characters (RFC 3986, section 2.2)
+ , "/%21%2A%27%28%29%3B%3A%40%26.html" @=? toUrl "/!*'();:@&.html"
+ , "/%3D%2B%24%2C/%3F%23%5B%5D.html" @=? toUrl "=+$,/?#[].html"
+ -- Test various characters that are nor reserved, nor unreserved.
+ , "/%E3%81%82%F0%9D%90%87%E2%88%80" @=? toUrl "\12354\119815\8704"
]
, fromAssertions "toSiteRoot"