@@ -0,0 +1,43 @@
1+--------------------------------------------------------------------------------
2+module Hakyll.Web.CompressCss.Tests
3+ ( tests
4+ ) where
5+
6+
7+--------------------------------------------------------------------------------
8+import Data.Char (toUpper)
9+import Test.Framework (Test, testGroup)
10+import Test.HUnit (assert, (@=?))
11+
12+
13+--------------------------------------------------------------------------------
14+import Hakyll.Web.CompressCss
15+import TestSuite.Util
16+
17+
18+--------------------------------------------------------------------------------
19+tests :: Test
20+tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
21+ [ fromAssertions "compressCss"
22+ [
23+ -- compress whitespace
24+ " something something " @=?
25+ compressCss " something \n\t\r something "
26+
27+ -- strip comments
28+ , "" @=?
29+ compressCss "/* abc { } ;; \n\t\r */"
30+
31+ -- compress separators
32+ , "}" @=?
33+ compressCss "; }"
34+ , "{};" @=?
35+ compressCss " { } ; "
36+ , ";" @=?
37+ compressCss ";;;;;;;"
38+
39+ -- some real-life css
40+ , "a:after{content: \" (\" attr(href) \")\"}" @=?
41+ compressCss "a:after { content: \" (\" attr(href) \")\"; }"
42+ ]
43+ ]