diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2013-06-16 09:05:41 -0700 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2013-06-16 09:05:41 -0700 |
commit | 832c6d3f9a150ed17c230a156230ca5556aa2250 (patch) | |
tree | 30f2132e232adde04e20c2eef0e44f6283a05296 /tests/Hakyll | |
parent | 537e72333f8deafa59219b60dcae0a4f52569317 (diff) | |
parent | 72ed15e174b467c60486ccdeeea65e8f13d60480 (diff) | |
download | hakyll-832c6d3f9a150ed17c230a156230ca5556aa2250.tar.gz |
Merge pull request #165 from nagisa/uri-sanitise
Better sanitising for URIs
Diffstat (limited to 'tests/Hakyll')
-rw-r--r-- | tests/Hakyll/Web/Html/Tests.hs | 13 |
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" |