on hakyll-2.1 help sign in
hakyll/tests/File.hs
42 lines 1.4 kB history raw
1module File
2 ( fileGroup
3 ) where
5import qualified Data.Map as M
7import Data.Binary
8import Test.Framework (testGroup)
9import Test.Framework.Providers.HUnit
10import Test.Framework.Providers.QuickCheck2
11import Test.HUnit
12import Test.QuickCheck
14import Text.Hakyll.File
16-- File test group.
17fileGroup = testGroup "File"
18 [ testCase "test_toRoot_1" test_toRoot_1
19 , testCase "test_toRoot_2" test_toRoot_2
20 , testCase "test_toRoot_3" test_toRoot_3
21 , testCase "test_removeSpaces_1" test_removeSpaces_1
22 , testCase "test_removeSpaces_2" test_removeSpaces_2
23 , testCase "test_havingExtension_1" test_havingExtension_1
24 , testCase "test_havingExtension_2" test_havingExtension_2
25 ]
28-- toRoot test cases
29test_toRoot_1 = toRoot "/posts/foo.html" @?= ".."
30test_toRoot_2 = toRoot "posts/foo.html" @?= ".."
31test_toRoot_3 = toRoot "foo.html" @?= "."
33-- removeSpaces test cases
34test_removeSpaces_1 = removeSpaces "$root/tags/random crap.html"
35 @?= "$root/tags/random-crap.html"
36test_removeSpaces_2 = removeSpaces "another simple example.zip"
37 @?= "another-simple-example.zip"
39-- Having extension test cases
40test_havingExtension_1 = havingExtension ".foo" ["file.bar", "file.txt"] @?= []
41test_havingExtension_2 = havingExtension ".foo" ["file.foo", "file.txt"]
42 @?= ["file.foo"]