From 40945cd717b044d6d13c8b46050447d0fca61974 Mon Sep 17 00:00:00 2001 From: Nicole Rauch Date: Sat, 10 Jun 2017 16:32:06 +0200 Subject: Some small CSS compression improvements * We now also compress whitespace around commas. * Remove whitespace around some other operators as well. * Clarified the code around the separator compression and even improved the code (one case slipped through unnoticed). --- tests/Hakyll/Web/CompressCss/Tests.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/Hakyll/Web/CompressCss/Tests.hs b/tests/Hakyll/Web/CompressCss/Tests.hs index 8521014..7420e4c 100644 --- a/tests/Hakyll/Web/CompressCss/Tests.hs +++ b/tests/Hakyll/Web/CompressCss/Tests.hs @@ -37,11 +37,15 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat -- compress separators , "}" @=? compressCss "; }" - , "{};" @=? compressCss " { } ; " + , ";{};" @=? compressCss " ; { } ; " + , "text," @=? compressCss "text , " + , "a>b" @=? compressCss "a > b" + , "a+b" @=? compressCss "a + b" + , "a!b" @=? compressCss "a ! b" -- compress whitespace even after this curly brace , "}" @=? compressCss "; } " -- but do not compress separators inside of constants - , "\" { } ; \"" @=? compressCss "\" { } ; \"" + , "\" { } ; , \"" @=? compressCss "\" { } ; , \"" -- don't compress separators at the start or end of constants , "\" }\"" @=? compressCss "\" }\"" , "\"{ \"" @=? compressCss "\"{ \"" @@ -51,7 +55,7 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat -- don't compress whitespace around separators in constants in the middle of a string , "abc '{ '" @=? compressCss "abc '{ '" , "abc \"{ \"" @=? compressCss "abc \"{ \"" - -- compress whitespace after colons + -- compress whitespace around colons , "abc:xyz" @=? compressCss "abc : xyz" -- compress multiple semicolons , ";" @=? compressCss ";;;;;;;" -- cgit v1.2.3