@@ -40,7 +40,10 @@ tests = [ testGroup "Util group" [ testProperty "trim length" prop_trim_length
4040 , testCase "renderDate 2" test_render_date1
4141 ]
4242
43− , testGroup "File group" [ testProperty "havingExtension count" prop_having_extension_count
43+ , testGroup "File group" [ testCase "toRoot 1" test_to_root1
44+ , testCase "toRoot 2" test_to_root2
45+ , testCase "toRoot 3" test_to_root3
46+ , testProperty "havingExtension count" prop_having_extension_count
4447 , testCase "havingExtension 1" test_having_extension1
4548 , testCase "havingExtension 2" test_having_extension2
4649 ]
@@ -93,6 +96,10 @@ test_render_date2 = M.lookup (B.pack "date") rendered @?= Just (B.pack "Unknown
9396 "Unknown date"
9497 (M.singleton (B.pack "path")
9598 (B.pack "2009-badness-30-a-title.markdown"))
99+-- toRoot test cases
100+test_to_root1 = toRoot "/posts/foo.html" @?= ".."
101+test_to_root2 = toRoot "posts/foo.html" @?= ".."
102+test_to_root3 = toRoot "foo.html" @?= ""
96103
97104-- Add an extension, and test that they have that extension
98105prop_having_extension_count names extension =