on hakyll-1.2 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}"