mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-23 12:49:40 +00:00
parent
a4aa9bb079
commit
d299a74670
@ -10555,6 +10555,23 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea
|
||||
'div [attr] :not(.class) {\n' +
|
||||
' color: red;\n' +
|
||||
'}');
|
||||
|
||||
// Issue #1233
|
||||
t(
|
||||
'.one {\n' +
|
||||
' color: #FFF;\n' +
|
||||
' // pseudo-element\n' +
|
||||
' span:not(*::selection) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'.two {\n' +
|
||||
' color: #000;\n' +
|
||||
' // pseudo-class\n' +
|
||||
' span:not(*:active) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}');
|
||||
|
||||
|
||||
//============================================================
|
||||
@ -10578,9 +10595,9 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea
|
||||
|
||||
|
||||
//============================================================
|
||||
// Issue #645
|
||||
// Issue #645, #1233
|
||||
reset_options();
|
||||
set_name('Issue #645');
|
||||
set_name('Issue #645, #1233');
|
||||
opts.selector_separator_newline = true;
|
||||
opts.preserve_newlines = true;
|
||||
opts.newline_between_rules = true;
|
||||
@ -10602,6 +10619,39 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'/* Comment after last rule */');
|
||||
t(
|
||||
'.one {\n' +
|
||||
' color: #FFF;\n' +
|
||||
' // pseudo-element\n' +
|
||||
' span:not(*::selection) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'.two {\n' +
|
||||
' color: #000;\n' +
|
||||
' // pseudo-class\n' +
|
||||
' span:not(*:active) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}',
|
||||
// -- output --
|
||||
'.one {\n' +
|
||||
' color: #FFF;\n' +
|
||||
'\n' +
|
||||
' // pseudo-element\n' +
|
||||
' span:not(*::selection) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'.two {\n' +
|
||||
' color: #000;\n' +
|
||||
'\n' +
|
||||
' // pseudo-class\n' +
|
||||
' span:not(*:active) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}');
|
||||
|
||||
|
||||
//============================================================
|
||||
|
@ -10438,6 +10438,23 @@ class CSSBeautifierTest(unittest.TestCase):
|
||||
'div [attr] :not(.class) {\n' +
|
||||
' color: red;\n' +
|
||||
'}')
|
||||
|
||||
# Issue #1233
|
||||
t(
|
||||
'.one {\n' +
|
||||
' color: #FFF;\n' +
|
||||
' // pseudo-element\n' +
|
||||
' span:not(*::selection) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'.two {\n' +
|
||||
' color: #000;\n' +
|
||||
' // pseudo-class\n' +
|
||||
' span:not(*:active) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}')
|
||||
|
||||
|
||||
#============================================================
|
||||
@ -10460,7 +10477,7 @@ class CSSBeautifierTest(unittest.TestCase):
|
||||
|
||||
|
||||
#============================================================
|
||||
# Issue #645
|
||||
# Issue #645, #1233
|
||||
self.reset_options()
|
||||
self.options.selector_separator_newline = true
|
||||
self.options.preserve_newlines = true
|
||||
@ -10483,6 +10500,39 @@ class CSSBeautifierTest(unittest.TestCase):
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'/* Comment after last rule */')
|
||||
t(
|
||||
'.one {\n' +
|
||||
' color: #FFF;\n' +
|
||||
' // pseudo-element\n' +
|
||||
' span:not(*::selection) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'.two {\n' +
|
||||
' color: #000;\n' +
|
||||
' // pseudo-class\n' +
|
||||
' span:not(*:active) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}',
|
||||
# -- output --
|
||||
'.one {\n' +
|
||||
' color: #FFF;\n' +
|
||||
'\n' +
|
||||
' // pseudo-element\n' +
|
||||
' span:not(*::selection) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'.two {\n' +
|
||||
' color: #000;\n' +
|
||||
'\n' +
|
||||
' // pseudo-class\n' +
|
||||
' span:not(*:active) {\n' +
|
||||
' margin-top: 0;\n' +
|
||||
' }\n' +
|
||||
'}')
|
||||
|
||||
|
||||
#============================================================
|
||||
|
@ -1361,6 +1361,25 @@ exports.test_data = {
|
||||
' color: red;',
|
||||
'}'
|
||||
]
|
||||
},
|
||||
{
|
||||
comment: "Issue #1233",
|
||||
unchanged: [
|
||||
'.one {',
|
||||
' color: #FFF;',
|
||||
' // pseudo-element',
|
||||
' span:not(*::selection) {',
|
||||
' margin-top: 0;',
|
||||
' }',
|
||||
'}',
|
||||
'.two {',
|
||||
' color: #000;',
|
||||
' // pseudo-class',
|
||||
' span:not(*:active) {',
|
||||
' margin-top: 0;',
|
||||
' }',
|
||||
'}'
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
@ -1386,7 +1405,7 @@ exports.test_data = {
|
||||
]
|
||||
}]
|
||||
}, {
|
||||
name: "Issue #645",
|
||||
name: "Issue #645, #1233",
|
||||
description: "",
|
||||
options: [
|
||||
{ name: "selector_separator_newline", value: "true" },
|
||||
@ -1395,26 +1414,64 @@ exports.test_data = {
|
||||
|
||||
],
|
||||
tests: [{
|
||||
unchanged: [
|
||||
'/* Comment above first rule */',
|
||||
'',
|
||||
'body {',
|
||||
' display: none;',
|
||||
'}',
|
||||
'',
|
||||
'/* Comment between rules */',
|
||||
'',
|
||||
'ul,',
|
||||
'',
|
||||
'/* Comment between selectors */',
|
||||
'',
|
||||
'li {',
|
||||
' display: none;',
|
||||
'}',
|
||||
'',
|
||||
'/* Comment after last rule */'
|
||||
]
|
||||
}]
|
||||
unchanged: [
|
||||
'/* Comment above first rule */',
|
||||
'',
|
||||
'body {',
|
||||
' display: none;',
|
||||
'}',
|
||||
'',
|
||||
'/* Comment between rules */',
|
||||
'',
|
||||
'ul,',
|
||||
'',
|
||||
'/* Comment between selectors */',
|
||||
'',
|
||||
'li {',
|
||||
' display: none;',
|
||||
'}',
|
||||
'',
|
||||
'/* Comment after last rule */'
|
||||
]
|
||||
},
|
||||
{
|
||||
input: [
|
||||
'.one {',
|
||||
' color: #FFF;',
|
||||
' // pseudo-element',
|
||||
' span:not(*::selection) {',
|
||||
' margin-top: 0;',
|
||||
' }',
|
||||
'}',
|
||||
'.two {',
|
||||
' color: #000;',
|
||||
' // pseudo-class',
|
||||
' span:not(*:active) {',
|
||||
' margin-top: 0;',
|
||||
' }',
|
||||
'}'
|
||||
],
|
||||
output: [
|
||||
'.one {',
|
||||
' color: #FFF;',
|
||||
'',
|
||||
' // pseudo-element',
|
||||
' span:not(*::selection) {',
|
||||
' margin-top: 0;',
|
||||
' }',
|
||||
'}',
|
||||
'',
|
||||
'.two {',
|
||||
' color: #000;',
|
||||
'',
|
||||
' // pseudo-class',
|
||||
' span:not(*:active) {',
|
||||
' margin-top: 0;',
|
||||
' }',
|
||||
'}'
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: "Extend Tests",
|
||||
description: "Test for '@extend'",
|
||||
|
Loading…
Reference in New Issue
Block a user