diff options
Diffstat (limited to 'tests/Hakyll/Web/CompressCss/Tests.hs')
-rw-r--r-- | tests/Hakyll/Web/CompressCss/Tests.hs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/Hakyll/Web/CompressCss/Tests.hs b/tests/Hakyll/Web/CompressCss/Tests.hs new file mode 100644 index 0000000..1430abf --- /dev/null +++ b/tests/Hakyll/Web/CompressCss/Tests.hs @@ -0,0 +1,43 @@ +-------------------------------------------------------------------------------- +module Hakyll.Web.CompressCss.Tests + ( tests + ) where + + +-------------------------------------------------------------------------------- +import Data.Char (toUpper) +import Test.Framework (Test, testGroup) +import Test.HUnit (assert, (@=?)) + + +-------------------------------------------------------------------------------- +import Hakyll.Web.CompressCss +import TestSuite.Util + + +-------------------------------------------------------------------------------- +tests :: Test +tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat + [ fromAssertions "compressCss" + [ + -- compress whitespace + " something something " @=? + compressCss " something \n\t\r something " + + -- strip comments + , "" @=? + compressCss "/* abc { } ;; \n\t\r */" + + -- compress separators + , "}" @=? + compressCss "; }" + , "{};" @=? + compressCss " { } ; " + , ";" @=? + compressCss ";;;;;;;" + + -- some real-life css + , "a:after{content: \" (\" attr(href) \")\"}" @=? + compressCss "a:after { content: \" (\" attr(href) \")\"; }" + ] + ] |