on ea1bb41 help sign in
hakyll/tests/CompressCss.hs
35 lines 1.2 kB history raw
1module CompressCss
2 ( compressCssGroup
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
13import Text.Hakyll.Internal.CompressCss
15-- CompressCss test group.
16compressCssGroup = testGroup "CompressCss"
17 [ testProperty "prop_compressCss_length" prop_compressCss_length
18 , testCase "test_compressCss_1" test_compressCss_1
19 , testCase "test_compressCss_2" test_compressCss_2
20 , testCase "test_compressCss_3" test_compressCss_3
21 , testCase "test_compressCss_4" test_compressCss_4
22 ]
24-- Css compression should always decrease the text length.
25prop_compressCss_length str = length str >= length (compressCss str)
27-- Compress Css test cases.
28test_compressCss_1 = compressCss "a { \n color : red; }" @?= "a{color:red}"
29test_compressCss_2 = compressCss "img {border :none;;;; }"
30 @?= "img{border:none}"
31test_compressCss_3 =
32 compressCss "p {font-size : 90%;} h1 {color :white;;; }"
33 @?= "p{font-size:90%}h1{color:white}"
34test_compressCss_4 = compressCss "a { /* /* red is pretty cool */ color: red; }"
35 @?= "a{color:red}"