on 1af0421 help sign in
hakyll/tests/CompressCss.hs
42 lines 1.4 kB history raw
1-- | Module testing @Text.Hakyll.Internal.CompressCss@.
2module CompressCss
3 ( compressCssGroup
4 ) where
6import qualified Data.Map as M
8import Data.Binary
9import Test.Framework (testGroup)
10import Test.Framework.Providers.HUnit
11import Test.Framework.Providers.QuickCheck2
12import Test.HUnit
14import Text.Hakyll.Internal.CompressCss
16-- CompressCss test group.
17compressCssGroup = testGroup "CompressCss"
18 [ testProperty "prop_compressCss_length" prop_compressCss_length
19 , testCase "test_compressCss_1" test_compressCss_1
20 , testCase "test_compressCss_2" test_compressCss_2
21 , testCase "test_compressCss_3" test_compressCss_3
22 , testCase "test_compressCss_4" test_compressCss_4
23 ]
25-- | Css compression should always decrease the text length.
26prop_compressCss_length str = length str >= length (compressCss str)
28-- | compressCss test case 1.
29test_compressCss_1 = compressCss "a { \n color : red; }" @?= "a{color:red}"
31-- | compressCss test case 2.
32test_compressCss_2 = compressCss "img {border :none;;;; }"
33 @?= "img{border:none}"
35-- | compressCss test case 3.
36test_compressCss_3 =
37 compressCss "p {font-size : 90%;} h1 {color :white;;; }"
38 @?= "p{font-size:90%}h1{color:white}"
40-- | compressCss test case 4.
41test_compressCss_4 = compressCss "a { /* /* red is pretty cool */ color: red; }"
42 @?= "a{color:red}"