From 202e520791372e5d4b64b2eb4ec6db9b9fa7ca68 Mon Sep 17 00:00:00 2001 From: Tayyeb Date: Tue, 18 Aug 2015 09:39:49 +0430 Subject: [PATCH] add tests for preserve_exclamation_comments, -/+ signs before float numbers --- csscompressor/tests/test_yui.py | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/csscompressor/tests/test_yui.py b/csscompressor/tests/test_yui.py index a0d6715..d5c1b9d 100644 --- a/csscompressor/tests/test_yui.py +++ b/csscompressor/tests/test_yui.py @@ -1044,6 +1044,30 @@ class TestYUI(BaseTest): self._test(input, output) + def test_yui_neg_decimals(self): + input = """ + ::selection { + margin: -0.6px -0.333pt -1.2em -8.8cm; + } + + """ + + output = """::selection{margin:-.6px -.333pt -1.2em -8.8cm}""" + + self._test(input, output) + + def test_yui_pos_decimals(self): + input = """ + ::selection { + margin: +0.6px +0.333pt +1.2em +8.8cm; + } + + """ + + output = """::selection{margin:.6px .333pt 1.2em 8.8cm}""" + + self._test(input, output) + def test_yui_dollar_header(self): input = """ /*! @@ -1402,6 +1426,29 @@ serve! */""" self._test(input, output) + def test_yui_remove_special_comments(self): + input = """ +/*!************88**** + Preserving comments + as they are + ******************** + Keep the initial ! + *******************/ +#yo { + ma: "ma"; +} +/*! +I said +pre- +serve! */ + """ + + output = """#yo{ma:"ma"}""" + + from csscompressor import compress + res = compress(input, preserve_exclamation_comments=False) + self.assertEqual(res, output) + def test_yui_star_underscore_hacks(self): input = """ #elementarr {