on master help sign in
More tests for toUrl function
commitd456f6ebf724fc83b7c23fa9625b0b484acc1f00 authorSimonas Kazlauskas <git@kazlauskas.me> dateSun 16 Jun 2013, 14:39 (13 years ago) parent537e723
1 file changed+9−4
tests/Hakyll/Web/Html/Tests.hs+9−4
tests/Hakyll/Web/Html/Tests.hs+9−4
@@ -43,10 +43,15 @@ tests = testGroup "Hakyll.Web.Html.Tests" $ concat
4343 ]
4444
4545 , fromAssertions "toUrl"
46− [ "/foo/bar.html" @=? toUrl "foo/bar.html"
47− , "/" @=? toUrl "/"
48− , "/funny-pics.html" @=? toUrl "/funny-pics.html"
49− , "/funny%20pics.html" @=? toUrl "funny pics.html"
46+ [ "/foo/bar.html" @=? toUrl "foo/bar.html"
47+ , "/" @=? toUrl "/"
48+ , "/funny-pics.html" @=? toUrl "/funny-pics.html"
49+ , "/funny%20pics.html" @=? toUrl "funny pics.html"
50+ -- Test various reserved characters (RFC 3986, section 2.2)
51+ , "/%21%2A%27%28%29%3B%3A%40%26.html" @=? toUrl "/!*'();:@&.html"
52+ , "/%3D%2B%24%2C/%3F%23%5B%5D.html" @=? toUrl "=+$,/?#[].html"
53+ -- Test various characters that are nor reserved, nor unreserved.
54+ , "/%E3%81%82%F0%9D%90%87%E2%88%80" @=? toUrl "\12354\119815\8704"
5055 ]
5156
5257 , fromAssertions "toSiteRoot"