Skip to content

Commit 202e520

Browse files
committed
add tests for preserve_exclamation_comments, -/+ signs before float numbers
1 parent bec5b9b commit 202e520

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

csscompressor/tests/test_yui.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,30 @@ def test_yui_decimals(self):
10441044

10451045
self._test(input, output)
10461046

1047+
def test_yui_neg_decimals(self):
1048+
input = """
1049+
::selection {
1050+
margin: -0.6px -0.333pt -1.2em -8.8cm;
1051+
}
1052+
1053+
"""
1054+
1055+
output = """::selection{margin:-.6px -.333pt -1.2em -8.8cm}"""
1056+
1057+
self._test(input, output)
1058+
1059+
def test_yui_pos_decimals(self):
1060+
input = """
1061+
::selection {
1062+
margin: +0.6px +0.333pt +1.2em +8.8cm;
1063+
}
1064+
1065+
"""
1066+
1067+
output = """::selection{margin:.6px .333pt 1.2em 8.8cm}"""
1068+
1069+
self._test(input, output)
1070+
10471071
def test_yui_dollar_header(self):
10481072
input = """
10491073
/*!
@@ -1402,6 +1426,29 @@ def test_yui_special_comments(self):
14021426

14031427
self._test(input, output)
14041428

1429+
def test_yui_remove_special_comments(self):
1430+
input = """
1431+
/*!************88****
1432+
Preserving comments
1433+
as they are
1434+
********************
1435+
Keep the initial !
1436+
*******************/
1437+
#yo {
1438+
ma: "ma";
1439+
}
1440+
/*!
1441+
I said
1442+
pre-
1443+
serve! */
1444+
"""
1445+
1446+
output = """#yo{ma:"ma"}"""
1447+
1448+
from csscompressor import compress
1449+
res = compress(input, preserve_exclamation_comments=False)
1450+
self.assertEqual(res, output)
1451+
14051452
def test_yui_star_underscore_hacks(self):
14061453
input = """
14071454
#elementarr {

0 commit comments

Comments
 (0)