"Fossies" - the Fresh Open Source Software Archive

Member "js-beautify-1.14.0/python/cssbeautifier/tests/generated/tests.py" (14 Jun 2021, 322736 Bytes) of package /linux/www/js-beautify-1.14.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "tests.py": 1.13.13_vs_1.14.0.

    1 #!/usr/bin/env python
    2 # -*- coding: utf-8 -*-
    3 
    4 '''
    5     AUTO-GENERATED. DO NOT MODIFY.
    6     Script: test/generate-tests.js
    7     Template: test/data/css/python.mustache
    8     Data: test/data/css/tests.js
    9 
   10   The MIT License (MIT)
   11 
   12   Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
   13 
   14   Permission is hereby granted, free of charge, to any person
   15   obtaining a copy of this software and associated documentation files
   16   (the "Software"), to deal in the Software without restriction,
   17   including without limitation the rights to use, copy, modify, merge,
   18   publish, distribute, sublicense, and/or sell copies of the Software,
   19   and to permit persons to whom the Software is furnished to do so,
   20   subject to the following conditions:
   21 
   22   The above copyright notice and this permission notice shall be
   23   included in all copies or substantial portions of the Software.
   24 
   25   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   26   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   27   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   28   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
   29   BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
   30   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   31   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   32   SOFTWARE.
   33 '''
   34 
   35 import unittest
   36 import cssbeautifier
   37 import copy
   38 
   39 class CSSBeautifierTest(unittest.TestCase):
   40 
   41     options = None
   42 
   43     @classmethod
   44     def setUpClass(cls):
   45         pass
   46 
   47     def reset_options(self):
   48         false = False
   49         true = True
   50 
   51         default_options = cssbeautifier.default_options()
   52         default_options.indent_size = 4
   53         default_options.indent_char = ' '
   54         default_options.selector_separator_newline = true
   55         default_options.end_with_newline = false
   56         default_options.newline_between_rules = false
   57 
   58         default_options.indent_size = 4
   59         default_options.indent_char = ' '
   60         default_options.selector_separator_newline = true
   61         default_options.brace_style = 'collapse'
   62         default_options.end_with_newline = false
   63         default_options.newline_between_rules = false
   64         default_options.space_around_combinator = false
   65         default_options.preserve_newlines = false
   66         default_options.space_around_selector_separator = false
   67 
   68         self.options = copy.copy(default_options)
   69 
   70     def testGenerated(self):
   71         self.reset_options()
   72         test_fragment = self.decodesto
   73         t = self.decodesto
   74 
   75         false = False
   76         true = True
   77 
   78 
   79         #============================================================
   80         # End With Newline - (end_with_newline = "true")
   81         self.reset_options()
   82         self.options.end_with_newline = true
   83         test_fragment('', '\n')
   84         test_fragment('   .tabs{}', '   .tabs {}\n')
   85         test_fragment(
   86             '   \n' +
   87             '\n' +
   88             '.tabs{}\n' +
   89             '\n' +
   90             '\n' +
   91             '\n',
   92             #  -- output --
   93             '   .tabs {}\n')
   94         test_fragment('\n')
   95 
   96         # End With Newline - (end_with_newline = "false")
   97         self.reset_options()
   98         self.options.end_with_newline = false
   99         test_fragment('')
  100         test_fragment('   .tabs{}', '   .tabs {}')
  101         test_fragment(
  102             '   \n' +
  103             '\n' +
  104             '.tabs{}\n' +
  105             '\n' +
  106             '\n' +
  107             '\n',
  108             #  -- output --
  109             '   .tabs {}')
  110         test_fragment('\n', '')
  111 
  112 
  113         #============================================================
  114         # Support Indent Level Options and Base Indent Autodetection - (indent_size = "4", indent_char = "" "", indent_with_tabs = "false")
  115         self.reset_options()
  116         self.options.indent_size = 4
  117         self.options.indent_char = ' '
  118         self.options.indent_with_tabs = false
  119         test_fragment('   a')
  120         test_fragment(
  121             '   .a {\n' +
  122             '  text-align: right;\n' +
  123             '}',
  124             #  -- output --
  125             '   .a {\n' +
  126             '       text-align: right;\n' +
  127             '   }')
  128         test_fragment(
  129             '   // This is a random comment\n' +
  130             '.a {\n' +
  131             '  text-align: right;\n' +
  132             '}',
  133             #  -- output --
  134             '   // This is a random comment\n' +
  135             '   .a {\n' +
  136             '       text-align: right;\n' +
  137             '   }')
  138 
  139         # Support Indent Level Options and Base Indent Autodetection - (indent_size = "4", indent_char = "" "", indent_with_tabs = "false", indent_level = "0")
  140         self.reset_options()
  141         self.options.indent_size = 4
  142         self.options.indent_char = ' '
  143         self.options.indent_with_tabs = false
  144         self.options.indent_level = 0
  145         test_fragment('   a')
  146         test_fragment(
  147             '   .a {\n' +
  148             '  text-align: right;\n' +
  149             '}',
  150             #  -- output --
  151             '   .a {\n' +
  152             '       text-align: right;\n' +
  153             '   }')
  154         test_fragment(
  155             '   // This is a random comment\n' +
  156             '.a {\n' +
  157             '  text-align: right;\n' +
  158             '}',
  159             #  -- output --
  160             '   // This is a random comment\n' +
  161             '   .a {\n' +
  162             '       text-align: right;\n' +
  163             '   }')
  164 
  165         # Support Indent Level Options and Base Indent Autodetection - (indent_size = "4", indent_char = "" "", indent_with_tabs = "false", indent_level = "1")
  166         self.reset_options()
  167         self.options.indent_size = 4
  168         self.options.indent_char = ' '
  169         self.options.indent_with_tabs = false
  170         self.options.indent_level = 1
  171         test_fragment('   a', '    a')
  172         test_fragment(
  173             '   .a {\n' +
  174             '  text-align: right;\n' +
  175             '}',
  176             #  -- output --
  177             '    .a {\n' +
  178             '        text-align: right;\n' +
  179             '    }')
  180         test_fragment(
  181             '   // This is a random comment\n' +
  182             '.a {\n' +
  183             '  text-align: right;\n' +
  184             '}',
  185             #  -- output --
  186             '    // This is a random comment\n' +
  187             '    .a {\n' +
  188             '        text-align: right;\n' +
  189             '    }')
  190 
  191         # Support Indent Level Options and Base Indent Autodetection - (indent_size = "4", indent_char = "" "", indent_with_tabs = "false", indent_level = "2")
  192         self.reset_options()
  193         self.options.indent_size = 4
  194         self.options.indent_char = ' '
  195         self.options.indent_with_tabs = false
  196         self.options.indent_level = 2
  197         test_fragment('a', '        a')
  198         test_fragment(
  199             '.a {\n' +
  200             '  text-align: right;\n' +
  201             '}',
  202             #  -- output --
  203             '        .a {\n' +
  204             '            text-align: right;\n' +
  205             '        }')
  206         test_fragment(
  207             '// This is a random comment\n' +
  208             '.a {\n' +
  209             '  text-align: right;\n' +
  210             '}',
  211             #  -- output --
  212             '        // This is a random comment\n' +
  213             '        .a {\n' +
  214             '            text-align: right;\n' +
  215             '        }')
  216 
  217         # Support Indent Level Options and Base Indent Autodetection - (indent_size = "4", indent_char = "" "", indent_with_tabs = "true", indent_level = "2")
  218         self.reset_options()
  219         self.options.indent_size = 4
  220         self.options.indent_char = ' '
  221         self.options.indent_with_tabs = true
  222         self.options.indent_level = 2
  223         test_fragment('a', '\t\ta')
  224         test_fragment(
  225             '.a {\n' +
  226             '  text-align: right;\n' +
  227             '}',
  228             #  -- output --
  229             '\t\t.a {\n' +
  230             '\t\t\ttext-align: right;\n' +
  231             '\t\t}')
  232         test_fragment(
  233             '// This is a random comment\n' +
  234             '.a {\n' +
  235             '  text-align: right;\n' +
  236             '}',
  237             #  -- output --
  238             '\t\t// This is a random comment\n' +
  239             '\t\t.a {\n' +
  240             '\t\t\ttext-align: right;\n' +
  241             '\t\t}')
  242 
  243         # Support Indent Level Options and Base Indent Autodetection - (indent_size = "4", indent_char = "" "", indent_with_tabs = "false", indent_level = "0")
  244         self.reset_options()
  245         self.options.indent_size = 4
  246         self.options.indent_char = ' '
  247         self.options.indent_with_tabs = false
  248         self.options.indent_level = 0
  249         test_fragment('\t   a')
  250         test_fragment(
  251             '\t   .a {\n' +
  252             '  text-align: right;\n' +
  253             '}',
  254             #  -- output --
  255             '\t   .a {\n' +
  256             '\t       text-align: right;\n' +
  257             '\t   }')
  258         test_fragment(
  259             '\t   // This is a random comment\n' +
  260             '.a {\n' +
  261             '  text-align: right;\n' +
  262             '}',
  263             #  -- output --
  264             '\t   // This is a random comment\n' +
  265             '\t   .a {\n' +
  266             '\t       text-align: right;\n' +
  267             '\t   }')
  268 
  269 
  270         #============================================================
  271         # Empty braces
  272         self.reset_options()
  273         t('.tabs{}', '.tabs {}')
  274         t('.tabs { }', '.tabs {}')
  275         t('.tabs    {    }', '.tabs {}')
  276         t(
  277             '.tabs    \n' +
  278             '{\n' +
  279             '    \n' +
  280             '  }',
  281             #  -- output --
  282             '.tabs {}')
  283 
  284 
  285         #============================================================
  286         # 
  287         self.reset_options()
  288         t(
  289             '#cboxOverlay {\n' +
  290             '    background: url(images/overlay.png) repeat 0 0;\n' +
  291             '    opacity: 0.9;\n' +
  292             '    filter: alpha(opacity = 90);\n' +
  293             '}',
  294             #  -- output --
  295             '#cboxOverlay {\n' +
  296             '    background: url(images/overlay.png) repeat 0 0;\n' +
  297             '    opacity: 0.9;\n' +
  298             '    filter: alpha(opacity=90);\n' +
  299             '}')
  300         
  301         # simple data uri base64 test
  302         t(
  303             'a { background: url(data:image/gif;base64,R0lGODlhCwALAJEAAAAAAP///xUVFf///yH5BAEAAAMALAAAAAALAAsAAAIPnI+py+0/hJzz0IruwjsVADs=); }',
  304             #  -- output --
  305             'a {\n' +
  306             '    background: url(data:image/gif;base64,R0lGODlhCwALAJEAAAAAAP///xUVFf///yH5BAEAAAMALAAAAAALAAsAAAIPnI+py+0/hJzz0IruwjsVADs=);\n' +
  307             '}')
  308         
  309         # non-base64 data
  310         t(
  311             'a { background: url(data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E); }',
  312             #  -- output --
  313             'a {\n' +
  314             '    background: url(data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E);\n' +
  315             '}')
  316         
  317         # Beautifier does not fix or mitigate bad data uri
  318         t(
  319             'a { background: url(data:  image/gif   base64,R0lGODlhCwALAJEAAAAAAP///xUVFf///yH5BAEAAAMALAAAAAALAAsAAAIPnI+py+0/hJzz0IruwjsVADs=); }',
  320             #  -- output --
  321             'a {\n' +
  322             '    background: url(data:  image/gif   base64,R0lGODlhCwALAJEAAAAAAP///xUVFf///yH5BAEAAAMALAAAAAALAAsAAAIPnI+py+0/hJzz0IruwjsVADs=);\n' +
  323             '}')
  324 
  325 
  326         #============================================================
  327         # Support simple language specific option inheritance/overriding - (indent_char = "" "", indent_size = "4", js = "{ "indent_size": 3 }", css = "{ "indent_size": 5 }")
  328         self.reset_options()
  329         self.options.indent_char = ' '
  330         self.options.indent_size = 4
  331         self.options.js = { 'indent_size': 3 }
  332         self.options.css = { 'indent_size': 5 }
  333         t(
  334             '.selector {\n' +
  335             '     font-size: 12px;\n' +
  336             '}')
  337 
  338         # Support simple language specific option inheritance/overriding - (indent_char = "" "", indent_size = "4", html = "{ "js": { "indent_size": 3 }, "css": { "indent_size": 5 } }")
  339         self.reset_options()
  340         self.options.indent_char = ' '
  341         self.options.indent_size = 4
  342         self.options.html = { 'js': { 'indent_size': 3 }, 'css': { 'indent_size': 5 } }
  343         t(
  344             '.selector {\n' +
  345             '    font-size: 12px;\n' +
  346             '}')
  347 
  348         # Support simple language specific option inheritance/overriding - (indent_char = "" "", indent_size = "9", html = "{ "js": { "indent_size": 3 }, "css": { "indent_size": 8 }, "indent_size": 2}", js = "{ "indent_size": 5 }", css = "{ "indent_size": 3 }")
  349         self.reset_options()
  350         self.options.indent_char = ' '
  351         self.options.indent_size = 9
  352         self.options.html = { 'js': { 'indent_size': 3 }, 'css': { 'indent_size': 8 }, 'indent_size': 2}
  353         self.options.js = { 'indent_size': 5 }
  354         self.options.css = { 'indent_size': 3 }
  355         t(
  356             '.selector {\n' +
  357             '   font-size: 12px;\n' +
  358             '}')
  359 
  360 
  361         #============================================================
  362         # Space Around Combinator - (space_around_combinator = "true")
  363         self.reset_options()
  364         self.options.space_around_combinator = true
  365         t('a>b{}', 'a > b {}')
  366         t('a~b{}', 'a ~ b {}')
  367         t('a+b{}', 'a + b {}')
  368         t('a+b>c{}', 'a + b > c {}')
  369         t('a > b{}', 'a > b {}')
  370         t('a ~ b{}', 'a ~ b {}')
  371         t('a + b{}', 'a + b {}')
  372         t('a + b > c{}', 'a + b > c {}')
  373         t(
  374             'a > b{width: calc(100% + 45px);}',
  375             #  -- output --
  376             'a > b {\n' +
  377             '    width: calc(100% + 45px);\n' +
  378             '}')
  379         t(
  380             'a ~ b{width: calc(100% + 45px);}',
  381             #  -- output --
  382             'a ~ b {\n' +
  383             '    width: calc(100% + 45px);\n' +
  384             '}')
  385         t(
  386             'a + b{width: calc(100% + 45px);}',
  387             #  -- output --
  388             'a + b {\n' +
  389             '    width: calc(100% + 45px);\n' +
  390             '}')
  391         t(
  392             'a + b > c{width: calc(100% + 45px);}',
  393             #  -- output --
  394             'a + b > c {\n' +
  395             '    width: calc(100% + 45px);\n' +
  396             '}')
  397 
  398         # Space Around Combinator - (space_around_combinator = "false")
  399         self.reset_options()
  400         self.options.space_around_combinator = false
  401         t('a>b{}', 'a>b {}')
  402         t('a~b{}', 'a~b {}')
  403         t('a+b{}', 'a+b {}')
  404         t('a+b>c{}', 'a+b>c {}')
  405         t('a > b{}', 'a>b {}')
  406         t('a ~ b{}', 'a~b {}')
  407         t('a + b{}', 'a+b {}')
  408         t('a + b > c{}', 'a+b>c {}')
  409         t(
  410             'a > b{width: calc(100% + 45px);}',
  411             #  -- output --
  412             'a>b {\n' +
  413             '    width: calc(100% + 45px);\n' +
  414             '}')
  415         t(
  416             'a ~ b{width: calc(100% + 45px);}',
  417             #  -- output --
  418             'a~b {\n' +
  419             '    width: calc(100% + 45px);\n' +
  420             '}')
  421         t(
  422             'a + b{width: calc(100% + 45px);}',
  423             #  -- output --
  424             'a+b {\n' +
  425             '    width: calc(100% + 45px);\n' +
  426             '}')
  427         t(
  428             'a + b > c{width: calc(100% + 45px);}',
  429             #  -- output --
  430             'a+b>c {\n' +
  431             '    width: calc(100% + 45px);\n' +
  432             '}')
  433 
  434         # Space Around Combinator - (space_around_selector_separator = "true")
  435         self.reset_options()
  436         self.options.space_around_selector_separator = true
  437         t('a>b{}', 'a > b {}')
  438         t('a~b{}', 'a ~ b {}')
  439         t('a+b{}', 'a + b {}')
  440         t('a+b>c{}', 'a + b > c {}')
  441         t('a > b{}', 'a > b {}')
  442         t('a ~ b{}', 'a ~ b {}')
  443         t('a + b{}', 'a + b {}')
  444         t('a + b > c{}', 'a + b > c {}')
  445         t(
  446             'a > b{width: calc(100% + 45px);}',
  447             #  -- output --
  448             'a > b {\n' +
  449             '    width: calc(100% + 45px);\n' +
  450             '}')
  451         t(
  452             'a ~ b{width: calc(100% + 45px);}',
  453             #  -- output --
  454             'a ~ b {\n' +
  455             '    width: calc(100% + 45px);\n' +
  456             '}')
  457         t(
  458             'a + b{width: calc(100% + 45px);}',
  459             #  -- output --
  460             'a + b {\n' +
  461             '    width: calc(100% + 45px);\n' +
  462             '}')
  463         t(
  464             'a + b > c{width: calc(100% + 45px);}',
  465             #  -- output --
  466             'a + b > c {\n' +
  467             '    width: calc(100% + 45px);\n' +
  468             '}')
  469 
  470 
  471         #============================================================
  472         # Issue 1373 -- Correct spacing around [attribute~=value]
  473         self.reset_options()
  474         t('header>div[class~="div-all"]')
  475 
  476 
  477         #============================================================
  478         # Selector Separator - (selector_separator_newline = "false", selector_separator = "" "", newline_between_rules = "true")
  479         self.reset_options()
  480         self.options.selector_separator_newline = false
  481         self.options.selector_separator = " "
  482         self.options.newline_between_rules = true
  483         t(
  484             '#bla, #foo{color:green}',
  485             #  -- output --
  486             '#bla, #foo {\n' +
  487             '    color: green\n' +
  488             '}')
  489         t(
  490             '#bla, #foo{color:green}\n' +
  491             '#bla, #foo{color:green}',
  492             #  -- output --
  493             '#bla, #foo {\n' +
  494             '    color: green\n' +
  495             '}\n' +
  496             '\n' +
  497             '#bla, #foo {\n' +
  498             '    color: green\n' +
  499             '}')
  500         t(
  501             '@media print {.tab{}}',
  502             #  -- output --
  503             '@media print {\n' +
  504             '    .tab {}\n' +
  505             '}')
  506         
  507         # This is bug #1489
  508         t(
  509             '@media print {.tab,.bat{}}',
  510             #  -- output --
  511             '@media print {\n' +
  512             '    .tab, .bat {}\n' +
  513             '}')
  514         
  515         # This is bug #1489
  516         t(
  517             '@media print {// comment\n' +
  518             '//comment 2\n' +
  519             '.bat{}}',
  520             #  -- output --
  521             '@media print {\n' +
  522             '\n' +
  523             '    // comment\n' +
  524             '    //comment 2\n' +
  525             '    .bat {}\n' +
  526             '}')
  527         t(
  528             '#bla, #foo{color:black}',
  529             #  -- output --
  530             '#bla, #foo {\n' +
  531             '    color: black\n' +
  532             '}')
  533         t(
  534             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  535             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  536             #  -- output --
  537             'a:first-child, a:first-child {\n' +
  538             '    color: red;\n' +
  539             '\n' +
  540             '    div:first-child, div:hover {\n' +
  541             '        color: black;\n' +
  542             '    }\n' +
  543             '}\n' +
  544             '\n' +
  545             'a:first-child, a:first-child {\n' +
  546             '    color: red;\n' +
  547             '\n' +
  548             '    div:first-child, div:hover {\n' +
  549             '        color: black;\n' +
  550             '    }\n' +
  551             '}')
  552 
  553         # Selector Separator - (selector_separator_newline = "false", selector_separator = "" "", newline_between_rules = "false")
  554         self.reset_options()
  555         self.options.selector_separator_newline = false
  556         self.options.selector_separator = " "
  557         self.options.newline_between_rules = false
  558         t(
  559             '#bla, #foo{color:green}',
  560             #  -- output --
  561             '#bla, #foo {\n' +
  562             '    color: green\n' +
  563             '}')
  564         t(
  565             '#bla, #foo{color:green}\n' +
  566             '#bla, #foo{color:green}',
  567             #  -- output --
  568             '#bla, #foo {\n' +
  569             '    color: green\n' +
  570             '}\n' +
  571             '#bla, #foo {\n' +
  572             '    color: green\n' +
  573             '}')
  574         t(
  575             '@media print {.tab{}}',
  576             #  -- output --
  577             '@media print {\n' +
  578             '    .tab {}\n' +
  579             '}')
  580         
  581         # This is bug #1489
  582         t(
  583             '@media print {.tab,.bat{}}',
  584             #  -- output --
  585             '@media print {\n' +
  586             '    .tab, .bat {}\n' +
  587             '}')
  588         
  589         # This is bug #1489
  590         t(
  591             '@media print {// comment\n' +
  592             '//comment 2\n' +
  593             '.bat{}}',
  594             #  -- output --
  595             '@media print {\n' +
  596             '    // comment\n' +
  597             '    //comment 2\n' +
  598             '    .bat {}\n' +
  599             '}')
  600         t(
  601             '#bla, #foo{color:black}',
  602             #  -- output --
  603             '#bla, #foo {\n' +
  604             '    color: black\n' +
  605             '}')
  606         t(
  607             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  608             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  609             #  -- output --
  610             'a:first-child, a:first-child {\n' +
  611             '    color: red;\n' +
  612             '    div:first-child, div:hover {\n' +
  613             '        color: black;\n' +
  614             '    }\n' +
  615             '}\n' +
  616             'a:first-child, a:first-child {\n' +
  617             '    color: red;\n' +
  618             '    div:first-child, div:hover {\n' +
  619             '        color: black;\n' +
  620             '    }\n' +
  621             '}')
  622 
  623         # Selector Separator - (selector_separator_newline = "false", selector_separator = ""  "", newline_between_rules = "false")
  624         self.reset_options()
  625         self.options.selector_separator_newline = false
  626         self.options.selector_separator = "  "
  627         self.options.newline_between_rules = false
  628         t(
  629             '#bla, #foo{color:green}',
  630             #  -- output --
  631             '#bla, #foo {\n' +
  632             '    color: green\n' +
  633             '}')
  634         t(
  635             '#bla, #foo{color:green}\n' +
  636             '#bla, #foo{color:green}',
  637             #  -- output --
  638             '#bla, #foo {\n' +
  639             '    color: green\n' +
  640             '}\n' +
  641             '#bla, #foo {\n' +
  642             '    color: green\n' +
  643             '}')
  644         t(
  645             '@media print {.tab{}}',
  646             #  -- output --
  647             '@media print {\n' +
  648             '    .tab {}\n' +
  649             '}')
  650         
  651         # This is bug #1489
  652         t(
  653             '@media print {.tab,.bat{}}',
  654             #  -- output --
  655             '@media print {\n' +
  656             '    .tab, .bat {}\n' +
  657             '}')
  658         
  659         # This is bug #1489
  660         t(
  661             '@media print {// comment\n' +
  662             '//comment 2\n' +
  663             '.bat{}}',
  664             #  -- output --
  665             '@media print {\n' +
  666             '    // comment\n' +
  667             '    //comment 2\n' +
  668             '    .bat {}\n' +
  669             '}')
  670         t(
  671             '#bla, #foo{color:black}',
  672             #  -- output --
  673             '#bla, #foo {\n' +
  674             '    color: black\n' +
  675             '}')
  676         t(
  677             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  678             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  679             #  -- output --
  680             'a:first-child, a:first-child {\n' +
  681             '    color: red;\n' +
  682             '    div:first-child, div:hover {\n' +
  683             '        color: black;\n' +
  684             '    }\n' +
  685             '}\n' +
  686             'a:first-child, a:first-child {\n' +
  687             '    color: red;\n' +
  688             '    div:first-child, div:hover {\n' +
  689             '        color: black;\n' +
  690             '    }\n' +
  691             '}')
  692 
  693         # Selector Separator - (selector_separator_newline = "true", selector_separator = "" "", newline_between_rules = "true")
  694         self.reset_options()
  695         self.options.selector_separator_newline = true
  696         self.options.selector_separator = " "
  697         self.options.newline_between_rules = true
  698         t(
  699             '#bla, #foo{color:green}',
  700             #  -- output --
  701             '#bla,\n#foo {\n' +
  702             '    color: green\n' +
  703             '}')
  704         t(
  705             '#bla, #foo{color:green}\n' +
  706             '#bla, #foo{color:green}',
  707             #  -- output --
  708             '#bla,\n#foo {\n' +
  709             '    color: green\n' +
  710             '}\n' +
  711             '\n' +
  712             '#bla,\n#foo {\n' +
  713             '    color: green\n' +
  714             '}')
  715         t(
  716             '@media print {.tab{}}',
  717             #  -- output --
  718             '@media print {\n' +
  719             '    .tab {}\n' +
  720             '}')
  721         
  722         # This is bug #1489
  723         t(
  724             '@media print {.tab,.bat{}}',
  725             #  -- output --
  726             '@media print {\n' +
  727             '\n' +
  728             '    .tab,\n    .bat {}\n' +
  729             '}')
  730         
  731         # This is bug #1489
  732         t(
  733             '@media print {// comment\n' +
  734             '//comment 2\n' +
  735             '.bat{}}',
  736             #  -- output --
  737             '@media print {\n' +
  738             '\n' +
  739             '    // comment\n' +
  740             '    //comment 2\n' +
  741             '    .bat {}\n' +
  742             '}')
  743         t(
  744             '#bla, #foo{color:black}',
  745             #  -- output --
  746             '#bla,\n#foo {\n' +
  747             '    color: black\n' +
  748             '}')
  749         t(
  750             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  751             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  752             #  -- output --
  753             'a:first-child,\na:first-child {\n' +
  754             '    color: red;\n' +
  755             '\n' +
  756             '    div:first-child,\n    div:hover {\n' +
  757             '        color: black;\n' +
  758             '    }\n' +
  759             '}\n' +
  760             '\n' +
  761             'a:first-child,\na:first-child {\n' +
  762             '    color: red;\n' +
  763             '\n' +
  764             '    div:first-child,\n    div:hover {\n' +
  765             '        color: black;\n' +
  766             '    }\n' +
  767             '}')
  768 
  769         # Selector Separator - (selector_separator_newline = "true", selector_separator = "" "", newline_between_rules = "false")
  770         self.reset_options()
  771         self.options.selector_separator_newline = true
  772         self.options.selector_separator = " "
  773         self.options.newline_between_rules = false
  774         t(
  775             '#bla, #foo{color:green}',
  776             #  -- output --
  777             '#bla,\n#foo {\n' +
  778             '    color: green\n' +
  779             '}')
  780         t(
  781             '#bla, #foo{color:green}\n' +
  782             '#bla, #foo{color:green}',
  783             #  -- output --
  784             '#bla,\n#foo {\n' +
  785             '    color: green\n' +
  786             '}\n' +
  787             '#bla,\n#foo {\n' +
  788             '    color: green\n' +
  789             '}')
  790         t(
  791             '@media print {.tab{}}',
  792             #  -- output --
  793             '@media print {\n' +
  794             '    .tab {}\n' +
  795             '}')
  796         
  797         # This is bug #1489
  798         t(
  799             '@media print {.tab,.bat{}}',
  800             #  -- output --
  801             '@media print {\n' +
  802             '    .tab,\n    .bat {}\n' +
  803             '}')
  804         
  805         # This is bug #1489
  806         t(
  807             '@media print {// comment\n' +
  808             '//comment 2\n' +
  809             '.bat{}}',
  810             #  -- output --
  811             '@media print {\n' +
  812             '    // comment\n' +
  813             '    //comment 2\n' +
  814             '    .bat {}\n' +
  815             '}')
  816         t(
  817             '#bla, #foo{color:black}',
  818             #  -- output --
  819             '#bla,\n#foo {\n' +
  820             '    color: black\n' +
  821             '}')
  822         t(
  823             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  824             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  825             #  -- output --
  826             'a:first-child,\na:first-child {\n' +
  827             '    color: red;\n' +
  828             '    div:first-child,\n    div:hover {\n' +
  829             '        color: black;\n' +
  830             '    }\n' +
  831             '}\n' +
  832             'a:first-child,\na:first-child {\n' +
  833             '    color: red;\n' +
  834             '    div:first-child,\n    div:hover {\n' +
  835             '        color: black;\n' +
  836             '    }\n' +
  837             '}')
  838 
  839         # Selector Separator - (selector_separator_newline = "true", selector_separator = ""  "", newline_between_rules = "false")
  840         self.reset_options()
  841         self.options.selector_separator_newline = true
  842         self.options.selector_separator = "  "
  843         self.options.newline_between_rules = false
  844         t(
  845             '#bla, #foo{color:green}',
  846             #  -- output --
  847             '#bla,\n#foo {\n' +
  848             '    color: green\n' +
  849             '}')
  850         t(
  851             '#bla, #foo{color:green}\n' +
  852             '#bla, #foo{color:green}',
  853             #  -- output --
  854             '#bla,\n#foo {\n' +
  855             '    color: green\n' +
  856             '}\n' +
  857             '#bla,\n#foo {\n' +
  858             '    color: green\n' +
  859             '}')
  860         t(
  861             '@media print {.tab{}}',
  862             #  -- output --
  863             '@media print {\n' +
  864             '    .tab {}\n' +
  865             '}')
  866         
  867         # This is bug #1489
  868         t(
  869             '@media print {.tab,.bat{}}',
  870             #  -- output --
  871             '@media print {\n' +
  872             '    .tab,\n    .bat {}\n' +
  873             '}')
  874         
  875         # This is bug #1489
  876         t(
  877             '@media print {// comment\n' +
  878             '//comment 2\n' +
  879             '.bat{}}',
  880             #  -- output --
  881             '@media print {\n' +
  882             '    // comment\n' +
  883             '    //comment 2\n' +
  884             '    .bat {}\n' +
  885             '}')
  886         t(
  887             '#bla, #foo{color:black}',
  888             #  -- output --
  889             '#bla,\n#foo {\n' +
  890             '    color: black\n' +
  891             '}')
  892         t(
  893             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  894             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  895             #  -- output --
  896             'a:first-child,\na:first-child {\n' +
  897             '    color: red;\n' +
  898             '    div:first-child,\n    div:hover {\n' +
  899             '        color: black;\n' +
  900             '    }\n' +
  901             '}\n' +
  902             'a:first-child,\na:first-child {\n' +
  903             '    color: red;\n' +
  904             '    div:first-child,\n    div:hover {\n' +
  905             '        color: black;\n' +
  906             '    }\n' +
  907             '}')
  908 
  909         # Selector Separator - (selector_separator_newline = "true", selector_separator = ""  "", brace_style = ""expand"", newline_between_rules = "false")
  910         self.reset_options()
  911         self.options.selector_separator_newline = true
  912         self.options.selector_separator = "  "
  913         self.options.brace_style = "expand"
  914         self.options.newline_between_rules = false
  915         t(
  916             '#bla, #foo{color:green}',
  917             #  -- output --
  918             '#bla,\n#foo\n{\n' +
  919             '    color: green\n' +
  920             '}')
  921         t(
  922             '#bla, #foo{color:green}\n' +
  923             '#bla, #foo{color:green}',
  924             #  -- output --
  925             '#bla,\n#foo\n{\n' +
  926             '    color: green\n' +
  927             '}\n' +
  928             '#bla,\n#foo\n{\n' +
  929             '    color: green\n' +
  930             '}')
  931         t(
  932             '@media print {.tab{}}',
  933             #  -- output --
  934             '@media print\n{\n' +
  935             '    .tab\n    {}\n' +
  936             '}')
  937         
  938         # This is bug #1489
  939         t(
  940             '@media print {.tab,.bat{}}',
  941             #  -- output --
  942             '@media print\n{\n' +
  943             '    .tab,\n    .bat\n    {}\n' +
  944             '}')
  945         
  946         # This is bug #1489
  947         t(
  948             '@media print {// comment\n' +
  949             '//comment 2\n' +
  950             '.bat{}}',
  951             #  -- output --
  952             '@media print\n{\n' +
  953             '    // comment\n' +
  954             '    //comment 2\n' +
  955             '    .bat\n    {}\n' +
  956             '}')
  957         t(
  958             '#bla, #foo{color:black}',
  959             #  -- output --
  960             '#bla,\n#foo\n{\n' +
  961             '    color: black\n' +
  962             '}')
  963         t(
  964             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}\n' +
  965             'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}',
  966             #  -- output --
  967             'a:first-child,\na:first-child\n{\n' +
  968             '    color: red;\n' +
  969             '    div:first-child,\n    div:hover\n    {\n' +
  970             '        color: black;\n' +
  971             '    }\n' +
  972             '}\n' +
  973             'a:first-child,\na:first-child\n{\n' +
  974             '    color: red;\n' +
  975             '    div:first-child,\n    div:hover\n    {\n' +
  976             '        color: black;\n' +
  977             '    }\n' +
  978             '}')
  979 
  980 
  981         #============================================================
  982         # Preserve Newlines - (preserve_newlines = "true")
  983         self.reset_options()
  984         self.options.preserve_newlines = true
  985         t('.div {}\n\n.span {}')
  986         t(
  987             '#bla, #foo{\n' +
  988             '    color:black;\n\n    font-size: 12px;\n' +
  989             '}',
  990             #  -- output --
  991             '#bla,\n' +
  992             '#foo {\n' +
  993             '    color: black;\n\n    font-size: 12px;\n' +
  994             '}')
  995 
  996         # Preserve Newlines - (preserve_newlines = "false")
  997         self.reset_options()
  998         self.options.preserve_newlines = false
  999         t('.div {}\n\n.span {}', '.div {}\n.span {}')
 1000         t(
 1001             '#bla, #foo{\n' +
 1002             '    color:black;\n\n    font-size: 12px;\n' +
 1003             '}',
 1004             #  -- output --
 1005             '#bla,\n' +
 1006             '#foo {\n' +
 1007             '    color: black;\n    font-size: 12px;\n' +
 1008             '}')
 1009 
 1010 
 1011         #============================================================
 1012         # Preserve Newlines and newline_between_rules
 1013         self.reset_options()
 1014         self.options.preserve_newlines = true
 1015         self.options.newline_between_rules = true
 1016         t(
 1017             '.div {}.span {}',
 1018             #  -- output --
 1019             '.div {}\n' +
 1020             '\n' +
 1021             '.span {}')
 1022         t(
 1023             '#bla, #foo{\n' +
 1024             '    color:black;\n' +
 1025             '    font-size: 12px;\n' +
 1026             '}',
 1027             #  -- output --
 1028             '#bla,\n' +
 1029             '#foo {\n' +
 1030             '    color: black;\n' +
 1031             '    font-size: 12px;\n' +
 1032             '}')
 1033         t(
 1034             '#bla, #foo{\n' +
 1035             '    color:black;\n' +
 1036             '\n' +
 1037             '\n' +
 1038             '    font-size: 12px;\n' +
 1039             '}',
 1040             #  -- output --
 1041             '#bla,\n' +
 1042             '#foo {\n' +
 1043             '    color: black;\n' +
 1044             '\n' +
 1045             '\n' +
 1046             '    font-size: 12px;\n' +
 1047             '}')
 1048         t(
 1049             '#bla,\n' +
 1050             '\n' +
 1051             '#foo {\n' +
 1052             '    color: black;\n' +
 1053             '    font-size: 12px;\n' +
 1054             '}')
 1055         t(
 1056             'a {\n' +
 1057             '    b: c;\n' +
 1058             '\n' +
 1059             '\n' +
 1060             '    d: {\n' +
 1061             '        e: f;\n' +
 1062             '    }\n' +
 1063             '}')
 1064         t(
 1065             '.div {}\n' +
 1066             '\n' +
 1067             '.span {}')
 1068         t(
 1069             'html {}\n' +
 1070             '\n' +
 1071             '/*this is a comment*/')
 1072         t(
 1073             '.div {\n' +
 1074             '    a: 1;\n' +
 1075             '\n' +
 1076             '\n' +
 1077             '    b: 2;\n' +
 1078             '}\n' +
 1079             '\n' +
 1080             '\n' +
 1081             '\n' +
 1082             '.span {\n' +
 1083             '    a: 1;\n' +
 1084             '}')
 1085         t(
 1086             '.div {\n' +
 1087             '\n' +
 1088             '\n' +
 1089             '    a: 1;\n' +
 1090             '\n' +
 1091             '\n' +
 1092             '    b: 2;\n' +
 1093             '}\n' +
 1094             '\n' +
 1095             '\n' +
 1096             '\n' +
 1097             '.span {\n' +
 1098             '    a: 1;\n' +
 1099             '}')
 1100         t(
 1101             '@media screen {\n' +
 1102             '    .div {\n' +
 1103             '        a: 1;\n' +
 1104             '\n' +
 1105             '\n' +
 1106             '        b: 2;\n' +
 1107             '    }\n' +
 1108             '\n' +
 1109             '\n' +
 1110             '\n' +
 1111             '    .span {\n' +
 1112             '        a: 1;\n' +
 1113             '    }\n' +
 1114             '}\n' +
 1115             '\n' +
 1116             '.div {}\n' +
 1117             '\n' +
 1118             '.span {}')
 1119 
 1120 
 1121         #============================================================
 1122         # Preserve Newlines and add tabs
 1123         self.reset_options()
 1124         self.options.preserve_newlines = true
 1125         t(
 1126             '.tool-tip {\n' +
 1127             '    position: relative;\n' +
 1128             '\n' +
 1129             '        \n' +
 1130             '    .tool-tip-content {\n' +
 1131             '        &>* {\n' +
 1132             '            margin-top: 0;\n' +
 1133             '        }\n' +
 1134             '        \n' +
 1135             '\n' +
 1136             '        .mixin-box-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .15));\n' +
 1137             '        padding: 1rem;\n' +
 1138             '        position: absolute;\n' +
 1139             '        z-index: 10;\n' +
 1140             '    }\n' +
 1141             '}',
 1142             #  -- output --
 1143             '.tool-tip {\n' +
 1144             '    position: relative;\n' +
 1145             '\n' +
 1146             '\n' +
 1147             '    .tool-tip-content {\n' +
 1148             '        &>* {\n' +
 1149             '            margin-top: 0;\n' +
 1150             '        }\n' +
 1151             '\n\n        .mixin-box-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .15));\n' +
 1152             '        padding: 1rem;\n' +
 1153             '        position: absolute;\n' +
 1154             '        z-index: 10;\n' +
 1155             '    }\n' +
 1156             '}')
 1157 
 1158 
 1159         #============================================================
 1160         # Issue #1338 -- Preserve Newlines within CSS rules
 1161         self.reset_options()
 1162         self.options.preserve_newlines = true
 1163         t(
 1164             'body {\n' +
 1165             '    grid-template-areas:\n' +
 1166             '        "header header"\n' +
 1167             '        "main   sidebar"\n' +
 1168             '        "footer footer";\n' +
 1169             '}')
 1170 
 1171 
 1172         #============================================================
 1173         # Newline Between Rules - (newline_between_rules = "true")
 1174         self.reset_options()
 1175         self.options.newline_between_rules = true
 1176         t(
 1177             '.div {}\n' +
 1178             '.span {}',
 1179             #  -- output --
 1180             '.div {}\n' +
 1181             '\n' +
 1182             '.span {}')
 1183         t(
 1184             '.div{}\n' +
 1185             '   \n' +
 1186             '.span{}',
 1187             #  -- output --
 1188             '.div {}\n' +
 1189             '\n' +
 1190             '.span {}')
 1191         t(
 1192             '.div {}    \n' +
 1193             '  \n' +
 1194             '.span { } \n',
 1195             #  -- output --
 1196             '.div {}\n' +
 1197             '\n' +
 1198             '.span {}')
 1199         t(
 1200             '.div {\n' +
 1201             '    \n' +
 1202             '} \n' +
 1203             '  .span {\n' +
 1204             ' }  ',
 1205             #  -- output --
 1206             '.div {}\n' +
 1207             '\n' +
 1208             '.span {}')
 1209         t(
 1210             '.selector1 {\n' +
 1211             '    margin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 1212             '}\n' +
 1213             '.div{height:15px;}',
 1214             #  -- output --
 1215             '.selector1 {\n' +
 1216             '    margin: 0;\n' +
 1217             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 1218             '}\n' +
 1219             '\n' +
 1220             '.div {\n' +
 1221             '    height: 15px;\n' +
 1222             '}')
 1223         t(
 1224             '.tabs{width:10px;//end of line comment\n' +
 1225             'height:10px;//another\n' +
 1226             '}\n' +
 1227             '.div{height:15px;}',
 1228             #  -- output --
 1229             '.tabs {\n' +
 1230             '    width: 10px; //end of line comment\n' +
 1231             '    height: 10px; //another\n' +
 1232             '}\n' +
 1233             '\n' +
 1234             '.div {\n' +
 1235             '    height: 15px;\n' +
 1236             '}')
 1237         t(
 1238             '#foo {\n' +
 1239             '    background-image: url(foo@2x.png);\n' +
 1240             '    @font-face {\n' +
 1241             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1242             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1243             '    }\n' +
 1244             '}\n' +
 1245             '.div{height:15px;}',
 1246             #  -- output --
 1247             '#foo {\n' +
 1248             '    background-image: url(foo@2x.png);\n' +
 1249             '\n' +
 1250             '    @font-face {\n' +
 1251             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1252             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1253             '    }\n' +
 1254             '}\n' +
 1255             '\n' +
 1256             '.div {\n' +
 1257             '    height: 15px;\n' +
 1258             '}')
 1259         t(
 1260             '@media screen {\n' +
 1261             '    #foo:hover {\n' +
 1262             '        background-image: url(foo@2x.png);\n' +
 1263             '    }\n' +
 1264             '    @font-face {\n' +
 1265             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1266             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1267             '    }\n' +
 1268             '}\n' +
 1269             '.div{height:15px;}',
 1270             #  -- output --
 1271             '@media screen {\n' +
 1272             '    #foo:hover {\n' +
 1273             '        background-image: url(foo@2x.png);\n' +
 1274             '    }\n' +
 1275             '\n' +
 1276             '    @font-face {\n' +
 1277             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1278             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1279             '    }\n' +
 1280             '}\n' +
 1281             '\n' +
 1282             '.div {\n' +
 1283             '    height: 15px;\n' +
 1284             '}')
 1285         t(
 1286             '@font-face {\n' +
 1287             '    font-family: "Bitstream Vera Serif Bold";\n' +
 1288             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1289             '}\n' +
 1290             '@media screen {\n' +
 1291             '    #foo:hover {\n' +
 1292             '        background-image: url(foo.png);\n' +
 1293             '    }\n' +
 1294             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 1295             '        @font-face {\n' +
 1296             '            font-family: "Helvetica Neue"\n' +
 1297             '        }\n' +
 1298             '        #foo:hover {\n' +
 1299             '            background-image: url(foo@2x.png);\n' +
 1300             '        }\n' +
 1301             '    }\n' +
 1302             '}',
 1303             #  -- output --
 1304             '@font-face {\n' +
 1305             '    font-family: "Bitstream Vera Serif Bold";\n' +
 1306             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1307             '}\n' +
 1308             '\n' +
 1309             '@media screen {\n' +
 1310             '    #foo:hover {\n' +
 1311             '        background-image: url(foo.png);\n' +
 1312             '    }\n' +
 1313             '\n' +
 1314             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 1315             '        @font-face {\n' +
 1316             '            font-family: "Helvetica Neue"\n' +
 1317             '        }\n' +
 1318             '\n' +
 1319             '        #foo:hover {\n' +
 1320             '            background-image: url(foo@2x.png);\n' +
 1321             '        }\n' +
 1322             '    }\n' +
 1323             '}')
 1324         t(
 1325             'a:first-child{color:red;div:first-child{color:black;}}\n' +
 1326             '.div{height:15px;}',
 1327             #  -- output --
 1328             'a:first-child {\n' +
 1329             '    color: red;\n' +
 1330             '\n' +
 1331             '    div:first-child {\n' +
 1332             '        color: black;\n' +
 1333             '    }\n' +
 1334             '}\n' +
 1335             '\n' +
 1336             '.div {\n' +
 1337             '    height: 15px;\n' +
 1338             '}')
 1339         t(
 1340             'a:first-child{color:red;div:not(.peq){color:black;}}\n' +
 1341             '.div{height:15px;}',
 1342             #  -- output --
 1343             'a:first-child {\n' +
 1344             '    color: red;\n' +
 1345             '\n' +
 1346             '    div:not(.peq) {\n' +
 1347             '        color: black;\n' +
 1348             '    }\n' +
 1349             '}\n' +
 1350             '\n' +
 1351             '.div {\n' +
 1352             '    height: 15px;\n' +
 1353             '}')
 1354         t(
 1355             '.list-group {\n' +
 1356             '    .list-group-item {\n' +
 1357             '    }\n' +
 1358             '\n' +
 1359             '    .list-group-icon {\n' +
 1360             '    }\n' +
 1361             '}\n' +
 1362             '\n' +
 1363             '.list-group-condensed {\n' +
 1364             '}',
 1365             #  -- output --
 1366             '.list-group {\n' +
 1367             '    .list-group-item {}\n' +
 1368             '\n' +
 1369             '    .list-group-icon {}\n' +
 1370             '}\n' +
 1371             '\n' +
 1372             '.list-group-condensed {}')
 1373         t(
 1374             '.list-group {\n' +
 1375             '    .list-group-item {\n' +
 1376             '        a:1\n' +
 1377             '    }\n' +
 1378             '    .list-group-item {\n' +
 1379             '        a:1\n' +
 1380             '    }\n' +
 1381             '    .list-group-icon {\n' +
 1382             '    }\n' +
 1383             '    .list-group-icon {\n' +
 1384             '    }\n' +
 1385             '}\n' +
 1386             '.list-group-condensed {\n' +
 1387             '}',
 1388             #  -- output --
 1389             '.list-group {\n' +
 1390             '    .list-group-item {\n' +
 1391             '        a: 1\n' +
 1392             '    }\n' +
 1393             '\n' +
 1394             '    .list-group-item {\n' +
 1395             '        a: 1\n' +
 1396             '    }\n' +
 1397             '\n' +
 1398             '    .list-group-icon {}\n' +
 1399             '\n' +
 1400             '    .list-group-icon {}\n' +
 1401             '}\n' +
 1402             '\n' +
 1403             '.list-group-condensed {}')
 1404         t(
 1405             '.list-group {\n' +
 1406             '    .list-group-item {\n' +
 1407             '        a:1\n' +
 1408             '    }\n' +
 1409             '    //this is my pre-comment\n' +
 1410             '    .list-group-item {\n' +
 1411             '        a:1\n' +
 1412             '    }\n' +
 1413             '    //this is a comment\n' +
 1414             '    .list-group-icon {\n' +
 1415             '    }\n' +
 1416             '    //this is also a comment\n' +
 1417             '    .list-group-icon {\n' +
 1418             '    }\n' +
 1419             '}\n' +
 1420             '.list-group-condensed {\n' +
 1421             '}',
 1422             #  -- output --
 1423             '.list-group {\n' +
 1424             '    .list-group-item {\n' +
 1425             '        a: 1\n' +
 1426             '    }\n' +
 1427             '\n' +
 1428             '    //this is my pre-comment\n' +
 1429             '    .list-group-item {\n' +
 1430             '        a: 1\n' +
 1431             '    }\n' +
 1432             '\n' +
 1433             '    //this is a comment\n' +
 1434             '    .list-group-icon {}\n' +
 1435             '\n' +
 1436             '    //this is also a comment\n' +
 1437             '    .list-group-icon {}\n' +
 1438             '}\n' +
 1439             '\n' +
 1440             '.list-group-condensed {}')
 1441         t(
 1442             '.list-group {\n' +
 1443             '    color: #38a0e5;\n' +
 1444             '    .list-group-item {\n' +
 1445             '        a:1\n' +
 1446             '    }\n' +
 1447             '    color: #38a0e5;\n' +
 1448             '    .list-group-item {\n' +
 1449             '        a:1\n' +
 1450             '    }\n' +
 1451             'color: #38a0e5;\n' +
 1452             '    .list-group-icon {\n' +
 1453             '    }\n' +
 1454             '    color: #38a0e5;\n' +
 1455             '    .list-group-icon {\n' +
 1456             '    }\n' +
 1457             '}\n' +
 1458             'color: #38a0e5;\n' +
 1459             '.list-group-condensed {\n' +
 1460             '}',
 1461             #  -- output --
 1462             '.list-group {\n' +
 1463             '    color: #38a0e5;\n' +
 1464             '\n' +
 1465             '    .list-group-item {\n' +
 1466             '        a: 1\n' +
 1467             '    }\n' +
 1468             '\n' +
 1469             '    color: #38a0e5;\n' +
 1470             '\n' +
 1471             '    .list-group-item {\n' +
 1472             '        a: 1\n' +
 1473             '    }\n' +
 1474             '\n' +
 1475             '    color: #38a0e5;\n' +
 1476             '\n' +
 1477             '    .list-group-icon {}\n' +
 1478             '\n' +
 1479             '    color: #38a0e5;\n' +
 1480             '\n' +
 1481             '    .list-group-icon {}\n' +
 1482             '}\n' +
 1483             '\n' +
 1484             'color: #38a0e5;\n' +
 1485             '\n' +
 1486             '.list-group-condensed {}')
 1487         t(
 1488             '@media only screen and (max-width: 40em) {\n' +
 1489             'header {\n' +
 1490             '    margin: 0 auto;\n' +
 1491             '    padding: 10px;\n' +
 1492             '    background: red;\n' +
 1493             '    }\n' +
 1494             'main {\n' +
 1495             '    margin: 20px auto;\n' +
 1496             '    padding: 4px;\n' +
 1497             '    background: blue;\n' +
 1498             '    }\n' +
 1499             '}',
 1500             #  -- output --
 1501             '@media only screen and (max-width: 40em) {\n' +
 1502             '    header {\n' +
 1503             '        margin: 0 auto;\n' +
 1504             '        padding: 10px;\n' +
 1505             '        background: red;\n' +
 1506             '    }\n' +
 1507             '\n' +
 1508             '    main {\n' +
 1509             '        margin: 20px auto;\n' +
 1510             '        padding: 4px;\n' +
 1511             '        background: blue;\n' +
 1512             '    }\n' +
 1513             '}')
 1514         t(
 1515             '.preloader {\n' +
 1516             '    height: 20px;\n' +
 1517             '    .line {\n' +
 1518             '        width: 1px;\n' +
 1519             '        height: 12px;\n' +
 1520             '        background: #38a0e5;\n' +
 1521             '        margin: 0 1px;\n' +
 1522             '        display: inline-block;\n' +
 1523             '        &.line-1 {\n' +
 1524             '            animation-delay: 800ms;\n' +
 1525             '        }\n' +
 1526             '        &.line-2 {\n' +
 1527             '            animation-delay: 600ms;\n' +
 1528             '        }\n' +
 1529             '    }\n' +
 1530             '    div {\n' +
 1531             '        color: #38a0e5;\n' +
 1532             '        font-family: "Arial", sans-serif;\n' +
 1533             '        font-size: 10px;\n' +
 1534             '        margin: 5px 0;\n' +
 1535             '    }\n' +
 1536             '}',
 1537             #  -- output --
 1538             '.preloader {\n' +
 1539             '    height: 20px;\n' +
 1540             '\n' +
 1541             '    .line {\n' +
 1542             '        width: 1px;\n' +
 1543             '        height: 12px;\n' +
 1544             '        background: #38a0e5;\n' +
 1545             '        margin: 0 1px;\n' +
 1546             '        display: inline-block;\n' +
 1547             '\n' +
 1548             '        &.line-1 {\n' +
 1549             '            animation-delay: 800ms;\n' +
 1550             '        }\n' +
 1551             '\n' +
 1552             '        &.line-2 {\n' +
 1553             '            animation-delay: 600ms;\n' +
 1554             '        }\n' +
 1555             '    }\n' +
 1556             '\n' +
 1557             '    div {\n' +
 1558             '        color: #38a0e5;\n' +
 1559             '        font-family: "Arial", sans-serif;\n' +
 1560             '        font-size: 10px;\n' +
 1561             '        margin: 5px 0;\n' +
 1562             '    }\n' +
 1563             '}')
 1564 
 1565         # Newline Between Rules - (newline_between_rules = "false")
 1566         self.reset_options()
 1567         self.options.newline_between_rules = false
 1568         t(
 1569             '.div {}\n' +
 1570             '.span {}')
 1571         t(
 1572             '.div{}\n' +
 1573             '   \n' +
 1574             '.span{}',
 1575             #  -- output --
 1576             '.div {}\n' +
 1577             '.span {}')
 1578         t(
 1579             '.div {}    \n' +
 1580             '  \n' +
 1581             '.span { } \n',
 1582             #  -- output --
 1583             '.div {}\n' +
 1584             '.span {}')
 1585         t(
 1586             '.div {\n' +
 1587             '    \n' +
 1588             '} \n' +
 1589             '  .span {\n' +
 1590             ' }  ',
 1591             #  -- output --
 1592             '.div {}\n' +
 1593             '.span {}')
 1594         t(
 1595             '.selector1 {\n' +
 1596             '    margin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 1597             '}\n' +
 1598             '.div{height:15px;}',
 1599             #  -- output --
 1600             '.selector1 {\n' +
 1601             '    margin: 0;\n' +
 1602             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 1603             '}\n' +
 1604             '.div {\n' +
 1605             '    height: 15px;\n' +
 1606             '}')
 1607         t(
 1608             '.tabs{width:10px;//end of line comment\n' +
 1609             'height:10px;//another\n' +
 1610             '}\n' +
 1611             '.div{height:15px;}',
 1612             #  -- output --
 1613             '.tabs {\n' +
 1614             '    width: 10px; //end of line comment\n' +
 1615             '    height: 10px; //another\n' +
 1616             '}\n' +
 1617             '.div {\n' +
 1618             '    height: 15px;\n' +
 1619             '}')
 1620         t(
 1621             '#foo {\n' +
 1622             '    background-image: url(foo@2x.png);\n' +
 1623             '    @font-face {\n' +
 1624             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1625             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1626             '    }\n' +
 1627             '}\n' +
 1628             '.div{height:15px;}',
 1629             #  -- output --
 1630             '#foo {\n' +
 1631             '    background-image: url(foo@2x.png);\n' +
 1632             '    @font-face {\n' +
 1633             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1634             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1635             '    }\n' +
 1636             '}\n' +
 1637             '.div {\n' +
 1638             '    height: 15px;\n' +
 1639             '}')
 1640         t(
 1641             '@media screen {\n' +
 1642             '    #foo:hover {\n' +
 1643             '        background-image: url(foo@2x.png);\n' +
 1644             '    }\n' +
 1645             '    @font-face {\n' +
 1646             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1647             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1648             '    }\n' +
 1649             '}\n' +
 1650             '.div{height:15px;}',
 1651             #  -- output --
 1652             '@media screen {\n' +
 1653             '    #foo:hover {\n' +
 1654             '        background-image: url(foo@2x.png);\n' +
 1655             '    }\n' +
 1656             '    @font-face {\n' +
 1657             '        font-family: "Bitstream Vera Serif Bold";\n' +
 1658             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1659             '    }\n' +
 1660             '}\n' +
 1661             '.div {\n' +
 1662             '    height: 15px;\n' +
 1663             '}')
 1664         t(
 1665             '@font-face {\n' +
 1666             '    font-family: "Bitstream Vera Serif Bold";\n' +
 1667             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 1668             '}\n' +
 1669             '@media screen {\n' +
 1670             '    #foo:hover {\n' +
 1671             '        background-image: url(foo.png);\n' +
 1672             '    }\n' +
 1673             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 1674             '        @font-face {\n' +
 1675             '            font-family: "Helvetica Neue"\n' +
 1676             '        }\n' +
 1677             '        #foo:hover {\n' +
 1678             '            background-image: url(foo@2x.png);\n' +
 1679             '        }\n' +
 1680             '    }\n' +
 1681             '}')
 1682         t(
 1683             'a:first-child{color:red;div:first-child{color:black;}}\n' +
 1684             '.div{height:15px;}',
 1685             #  -- output --
 1686             'a:first-child {\n' +
 1687             '    color: red;\n' +
 1688             '    div:first-child {\n' +
 1689             '        color: black;\n' +
 1690             '    }\n' +
 1691             '}\n' +
 1692             '.div {\n' +
 1693             '    height: 15px;\n' +
 1694             '}')
 1695         t(
 1696             'a:first-child{color:red;div:not(.peq){color:black;}}\n' +
 1697             '.div{height:15px;}',
 1698             #  -- output --
 1699             'a:first-child {\n' +
 1700             '    color: red;\n' +
 1701             '    div:not(.peq) {\n' +
 1702             '        color: black;\n' +
 1703             '    }\n' +
 1704             '}\n' +
 1705             '.div {\n' +
 1706             '    height: 15px;\n' +
 1707             '}')
 1708         t(
 1709             '.list-group {\n' +
 1710             '    .list-group-item {\n' +
 1711             '    }\n' +
 1712             '\n' +
 1713             '    .list-group-icon {\n' +
 1714             '    }\n' +
 1715             '}\n' +
 1716             '\n' +
 1717             '.list-group-condensed {\n' +
 1718             '}',
 1719             #  -- output --
 1720             '.list-group {\n' +
 1721             '    .list-group-item {}\n' +
 1722             '    .list-group-icon {}\n' +
 1723             '}\n' +
 1724             '.list-group-condensed {}')
 1725         t(
 1726             '.list-group {\n' +
 1727             '    .list-group-item {\n' +
 1728             '        a:1\n' +
 1729             '    }\n' +
 1730             '    .list-group-item {\n' +
 1731             '        a:1\n' +
 1732             '    }\n' +
 1733             '    .list-group-icon {\n' +
 1734             '    }\n' +
 1735             '    .list-group-icon {\n' +
 1736             '    }\n' +
 1737             '}\n' +
 1738             '.list-group-condensed {\n' +
 1739             '}',
 1740             #  -- output --
 1741             '.list-group {\n' +
 1742             '    .list-group-item {\n' +
 1743             '        a: 1\n' +
 1744             '    }\n' +
 1745             '    .list-group-item {\n' +
 1746             '        a: 1\n' +
 1747             '    }\n' +
 1748             '    .list-group-icon {}\n' +
 1749             '    .list-group-icon {}\n' +
 1750             '}\n' +
 1751             '.list-group-condensed {}')
 1752         t(
 1753             '.list-group {\n' +
 1754             '    .list-group-item {\n' +
 1755             '        a:1\n' +
 1756             '    }\n' +
 1757             '    //this is my pre-comment\n' +
 1758             '    .list-group-item {\n' +
 1759             '        a:1\n' +
 1760             '    }\n' +
 1761             '    //this is a comment\n' +
 1762             '    .list-group-icon {\n' +
 1763             '    }\n' +
 1764             '    //this is also a comment\n' +
 1765             '    .list-group-icon {\n' +
 1766             '    }\n' +
 1767             '}\n' +
 1768             '.list-group-condensed {\n' +
 1769             '}',
 1770             #  -- output --
 1771             '.list-group {\n' +
 1772             '    .list-group-item {\n' +
 1773             '        a: 1\n' +
 1774             '    }\n' +
 1775             '    //this is my pre-comment\n' +
 1776             '    .list-group-item {\n' +
 1777             '        a: 1\n' +
 1778             '    }\n' +
 1779             '    //this is a comment\n' +
 1780             '    .list-group-icon {}\n' +
 1781             '    //this is also a comment\n' +
 1782             '    .list-group-icon {}\n' +
 1783             '}\n' +
 1784             '.list-group-condensed {}')
 1785         t(
 1786             '.list-group {\n' +
 1787             '    color: #38a0e5;\n' +
 1788             '    .list-group-item {\n' +
 1789             '        a:1\n' +
 1790             '    }\n' +
 1791             '    color: #38a0e5;\n' +
 1792             '    .list-group-item {\n' +
 1793             '        a:1\n' +
 1794             '    }\n' +
 1795             'color: #38a0e5;\n' +
 1796             '    .list-group-icon {\n' +
 1797             '    }\n' +
 1798             '    color: #38a0e5;\n' +
 1799             '    .list-group-icon {\n' +
 1800             '    }\n' +
 1801             '}\n' +
 1802             'color: #38a0e5;\n' +
 1803             '.list-group-condensed {\n' +
 1804             '}',
 1805             #  -- output --
 1806             '.list-group {\n' +
 1807             '    color: #38a0e5;\n' +
 1808             '    .list-group-item {\n' +
 1809             '        a: 1\n' +
 1810             '    }\n' +
 1811             '    color: #38a0e5;\n' +
 1812             '    .list-group-item {\n' +
 1813             '        a: 1\n' +
 1814             '    }\n' +
 1815             '    color: #38a0e5;\n' +
 1816             '    .list-group-icon {}\n' +
 1817             '    color: #38a0e5;\n' +
 1818             '    .list-group-icon {}\n' +
 1819             '}\n' +
 1820             'color: #38a0e5;\n' +
 1821             '.list-group-condensed {}')
 1822         t(
 1823             '@media only screen and (max-width: 40em) {\n' +
 1824             'header {\n' +
 1825             '    margin: 0 auto;\n' +
 1826             '    padding: 10px;\n' +
 1827             '    background: red;\n' +
 1828             '    }\n' +
 1829             'main {\n' +
 1830             '    margin: 20px auto;\n' +
 1831             '    padding: 4px;\n' +
 1832             '    background: blue;\n' +
 1833             '    }\n' +
 1834             '}',
 1835             #  -- output --
 1836             '@media only screen and (max-width: 40em) {\n' +
 1837             '    header {\n' +
 1838             '        margin: 0 auto;\n' +
 1839             '        padding: 10px;\n' +
 1840             '        background: red;\n' +
 1841             '    }\n' +
 1842             '    main {\n' +
 1843             '        margin: 20px auto;\n' +
 1844             '        padding: 4px;\n' +
 1845             '        background: blue;\n' +
 1846             '    }\n' +
 1847             '}')
 1848         t(
 1849             '.preloader {\n' +
 1850             '    height: 20px;\n' +
 1851             '    .line {\n' +
 1852             '        width: 1px;\n' +
 1853             '        height: 12px;\n' +
 1854             '        background: #38a0e5;\n' +
 1855             '        margin: 0 1px;\n' +
 1856             '        display: inline-block;\n' +
 1857             '        &.line-1 {\n' +
 1858             '            animation-delay: 800ms;\n' +
 1859             '        }\n' +
 1860             '        &.line-2 {\n' +
 1861             '            animation-delay: 600ms;\n' +
 1862             '        }\n' +
 1863             '    }\n' +
 1864             '    div {\n' +
 1865             '        color: #38a0e5;\n' +
 1866             '        font-family: "Arial", sans-serif;\n' +
 1867             '        font-size: 10px;\n' +
 1868             '        margin: 5px 0;\n' +
 1869             '    }\n' +
 1870             '}')
 1871 
 1872 
 1873         #============================================================
 1874         # Functions braces
 1875         self.reset_options()
 1876         t('.tabs(){}', '.tabs() {}')
 1877         t('.tabs (){}', '.tabs () {}')
 1878         t(
 1879             '.tabs (pa, pa(1,2)), .cols { }',
 1880             #  -- output --
 1881             '.tabs (pa, pa(1, 2)),\n' +
 1882             '.cols {}')
 1883         t(
 1884             '.tabs(pa, pa(1,2)), .cols { }',
 1885             #  -- output --
 1886             '.tabs(pa, pa(1, 2)),\n' +
 1887             '.cols {}')
 1888         t('.tabs (   )   {    }', '.tabs () {}')
 1889         t('.tabs(   )   {    }', '.tabs() {}')
 1890         t(
 1891             '.tabs  (t, t2)  \n' +
 1892             '{\n' +
 1893             '  key: val(p1  ,p2);  \n' +
 1894             '  }',
 1895             #  -- output --
 1896             '.tabs (t, t2) {\n' +
 1897             '    key: val(p1, p2);\n' +
 1898             '}')
 1899         t(
 1900             '.box-shadow(@shadow: 0 1px 3px rgba(0, 0, 0, .25)) {\n' +
 1901             '    -webkit-box-shadow: @shadow;\n' +
 1902             '    -moz-box-shadow: @shadow;\n' +
 1903             '    box-shadow: @shadow;\n' +
 1904             '}')
 1905 
 1906 
 1907         #============================================================
 1908         # Beautify preserve formatting
 1909         self.reset_options()
 1910         self.options.indent_size = 4
 1911         self.options.indent_char = ' '
 1912         self.options.preserve_newlines = true
 1913         
 1914         # Directive: ignore
 1915         t(
 1916             '/* beautify ignore:start */\n' +
 1917             '/* beautify ignore:end */')
 1918         t(
 1919             '/* beautify ignore:start */\n' +
 1920             '   var a,,,{ 1;\n' +
 1921             ' .div {}/* beautify ignore:end */')
 1922         t(
 1923             '.div {}\n' +
 1924             '\n' +
 1925             '/* beautify ignore:start */\n' +
 1926             '   .div {}var a = 1;\n' +
 1927             '/* beautify ignore:end */')
 1928         
 1929         # ignore starts _after_ the start comment, ends after the end comment
 1930         t('/* beautify ignore:start */     {asdklgh;y;+++;dd2d}/* beautify ignore:end */')
 1931         t('/* beautify ignore:start */  {asdklgh;y;+++;dd2d}    /* beautify ignore:end */')
 1932         t(
 1933             '.div {}/* beautify ignore:start */\n' +
 1934             '   .div {}var a,,,{ 1;\n' +
 1935             '/*beautify ignore:end*/',
 1936             #  -- output --
 1937             '.div {}\n' +
 1938             '/* beautify ignore:start */\n' +
 1939             '   .div {}var a,,,{ 1;\n' +
 1940             '/*beautify ignore:end*/')
 1941         t(
 1942             '.div {}\n' +
 1943             '  /* beautify ignore:start */\n' +
 1944             '   .div {}var a,,,{ 1;\n' +
 1945             '/* beautify ignore:end */',
 1946             #  -- output --
 1947             '.div {}\n' +
 1948             '/* beautify ignore:start */\n' +
 1949             '   .div {}var a,,,{ 1;\n' +
 1950             '/* beautify ignore:end */')
 1951         t(
 1952             '.div {\n' +
 1953             '    /* beautify ignore:start */\n' +
 1954             '    one   :  1\n' +
 1955             '    two   :  2,\n' +
 1956             '    three :  {\n' +
 1957             '    ten   : 10\n' +
 1958             '    /* beautify ignore:end */\n' +
 1959             '}')
 1960         t(
 1961             '.div {\n' +
 1962             '/* beautify ignore:start */\n' +
 1963             '    one   :  1\n' +
 1964             '    two   :  2,\n' +
 1965             '    three :  {\n' +
 1966             '    ten   : 10\n' +
 1967             '/* beautify ignore:end */\n' +
 1968             '}',
 1969             #  -- output --
 1970             '.div {\n' +
 1971             '    /* beautify ignore:start */\n' +
 1972             '    one   :  1\n' +
 1973             '    two   :  2,\n' +
 1974             '    three :  {\n' +
 1975             '    ten   : 10\n' +
 1976             '/* beautify ignore:end */\n' +
 1977             '}')
 1978         t(
 1979             '.div {\n' +
 1980             '/* beautify ignore:start */\n' +
 1981             '    one   :  1\n' +
 1982             ' /* beautify ignore:end */\n' +
 1983             '    two   :  2,\n' +
 1984             '/* beautify ignore:start */\n' +
 1985             '    three :  {\n' +
 1986             '    ten   : 10\n' +
 1987             '/* beautify ignore:end */\n' +
 1988             '}',
 1989             #  -- output --
 1990             '.div {\n' +
 1991             '    /* beautify ignore:start */\n' +
 1992             '    one   :  1\n' +
 1993             ' /* beautify ignore:end */\n' +
 1994             '    two : 2,\n' +
 1995             '    /* beautify ignore:start */\n' +
 1996             '    three :  {\n' +
 1997             '    ten   : 10\n' +
 1998             '/* beautify ignore:end */\n' +
 1999             '}')
 2000 
 2001 
 2002         #============================================================
 2003         # Comments - (preserve_newlines = "false", newline_between_rules = "false")
 2004         self.reset_options()
 2005         self.options.preserve_newlines = false
 2006         self.options.newline_between_rules = false
 2007         t('/* header comment newlines on */')
 2008         t(
 2009             '@import "custom.css";.rule{}',
 2010             #  -- output --
 2011             '@import "custom.css";\n' +
 2012             '.rule {}')
 2013         t(
 2014             '.tabs{/* test */}',
 2015             #  -- output --
 2016             '.tabs {\n' +
 2017             '    /* test */\n' +
 2018             '}')
 2019         
 2020         # #1185
 2021         t(
 2022             '/* header */.tabs{}',
 2023             #  -- output --
 2024             '/* header */\n' +
 2025             '.tabs {}')
 2026         t(
 2027             '.tabs {/* non-header */width:10px;}',
 2028             #  -- output --
 2029             '.tabs {\n' +
 2030             '    /* non-header */\n' +
 2031             '    width: 10px;\n' +
 2032             '}')
 2033         t('/* header')
 2034         t('// comment')
 2035         t('/*')
 2036         t('//')
 2037         t(
 2038             '.selector1 {margin: 0;/* This is a comment including an url http://domain.com/path/to/file.ext */}',
 2039             #  -- output --
 2040             '.selector1 {\n' +
 2041             '    margin: 0;\n' +
 2042             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 2043             '}')
 2044         
 2045         # single line comment support (less/sass)
 2046         t(
 2047             '.tabs{// comment\n' +
 2048             'width:10px;}',
 2049             #  -- output --
 2050             '.tabs {\n' +
 2051             '    // comment\n' +
 2052             '    width: 10px;\n' +
 2053             '}')
 2054         t(
 2055             '.tabs{// comment\n' +
 2056             'width:10px;}',
 2057             #  -- output --
 2058             '.tabs {\n' +
 2059             '    // comment\n' +
 2060             '    width: 10px;\n' +
 2061             '}')
 2062         t(
 2063             '//comment\n' +
 2064             '.tabs{width:10px;}',
 2065             #  -- output --
 2066             '//comment\n' +
 2067             '.tabs {\n' +
 2068             '    width: 10px;\n' +
 2069             '}')
 2070         t(
 2071             '.tabs{//comment\n' +
 2072             '//2nd single line comment\n' +
 2073             'width:10px;}',
 2074             #  -- output --
 2075             '.tabs {\n' +
 2076             '    //comment\n' +
 2077             '    //2nd single line comment\n' +
 2078             '    width: 10px;\n' +
 2079             '}')
 2080         t(
 2081             '.tabs{width:10px;//end of line comment\n' +
 2082             '}',
 2083             #  -- output --
 2084             '.tabs {\n' +
 2085             '    width: 10px; //end of line comment\n' +
 2086             '}')
 2087         t(
 2088             '.tabs{width:10px;//end of line comment\n' +
 2089             'height:10px;}',
 2090             #  -- output --
 2091             '.tabs {\n' +
 2092             '    width: 10px; //end of line comment\n' +
 2093             '    height: 10px;\n' +
 2094             '}')
 2095         t(
 2096             '.tabs{width:10px;//end of line comment\n' +
 2097             'height:10px;//another nl\n' +
 2098             '}',
 2099             #  -- output --
 2100             '.tabs {\n' +
 2101             '    width: 10px; //end of line comment\n' +
 2102             '    height: 10px; //another nl\n' +
 2103             '}')
 2104         t(
 2105             '.tabs{width: 10px;   // comment follows rule\n' +
 2106             '// another comment new line\n' +
 2107             '}',
 2108             #  -- output --
 2109             '.tabs {\n' +
 2110             '    width: 10px; // comment follows rule\n' +
 2111             '    // another comment new line\n' +
 2112             '}')
 2113         
 2114         # #1165
 2115         t(
 2116             '.tabs{width: 10px;\n' +
 2117             '        // comment follows rule\n' +
 2118             '// another comment new line\n' +
 2119             '}',
 2120             #  -- output --
 2121             '.tabs {\n' +
 2122             '    width: 10px;\n' +
 2123             '    // comment follows rule\n' +
 2124             '    // another comment new line\n' +
 2125             '}')
 2126         
 2127         # #736
 2128         t(
 2129             '/*\n' +
 2130             ' * comment\n' +
 2131             ' *//* another comment */body{}',
 2132             #  -- output --
 2133             '/*\n' +
 2134             ' * comment\n' +
 2135             ' */\n' +
 2136             '/* another comment */\n' +
 2137             'body {}')
 2138         
 2139         # #1348
 2140         t(
 2141             '.demoa1 {text-align:left; //demoa1 instructions for LESS note visibility only\n' +
 2142             '}.demob {text-align: right;}',
 2143             #  -- output --
 2144             '.demoa1 {\n' +
 2145             '    text-align: left; //demoa1 instructions for LESS note visibility only\n' +
 2146             '}\n' +
 2147             '.demob {\n' +
 2148             '    text-align: right;\n' +
 2149             '}')
 2150         
 2151         # #1440
 2152         t(
 2153             '#search-text {\n' +
 2154             '  width: 43%;\n' +
 2155             '  // height: 100%;\n' +
 2156             '  border: none;\n' +
 2157             '}',
 2158             #  -- output --
 2159             '#search-text {\n' +
 2160             '    width: 43%;\n' +
 2161             '    // height: 100%;\n' +
 2162             '    border: none;\n' +
 2163             '}')
 2164         t(
 2165             '.demoa2 {text-align:left;}//demob instructions for LESS note visibility only\n' +
 2166             '.demob {text-align: right}',
 2167             #  -- output --
 2168             '.demoa2 {\n' +
 2169             '    text-align: left;\n' +
 2170             '}\n' +
 2171             '//demob instructions for LESS note visibility only\n' +
 2172             '.demob {\n' +
 2173             '    text-align: right\n' +
 2174             '}')
 2175         
 2176         # new lines between rules - #531 and #857
 2177         t(
 2178             '.div{}\n' +
 2179             '.span {}',
 2180             #  -- output --
 2181             '.div {}\n' +
 2182             '.span {}')
 2183         t(
 2184             '/**//**///\n' +
 2185             '/**/.div{}/**//**///\n' +
 2186             '/**/.span {}',
 2187             #  -- output --
 2188             '/**/\n' +
 2189             '/**/\n' +
 2190             '//\n' +
 2191             '/**/\n' +
 2192             '.div {}\n' +
 2193             '/**/\n' +
 2194             '/**/\n' +
 2195             '//\n' +
 2196             '/**/\n' +
 2197             '.span {}')
 2198         t(
 2199             '//\n' +
 2200             '.div{}//\n' +
 2201             '.span {}',
 2202             #  -- output --
 2203             '//\n' +
 2204             '.div {}\n' +
 2205             '//\n' +
 2206             '.span {}')
 2207         t(
 2208             '.selector1 {margin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */}\n' +
 2209             '.div{height:15px;}',
 2210             #  -- output --
 2211             '.selector1 {\n' +
 2212             '    margin: 0;\n' +
 2213             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 2214             '}\n' +
 2215             '.div {\n' +
 2216             '    height: 15px;\n' +
 2217             '}')
 2218         t(
 2219             '.tabs{width:10px;//end of line comment\n' +
 2220             'height:10px;//another\n' +
 2221             '}.div{height:15px;}',
 2222             #  -- output --
 2223             '.tabs {\n' +
 2224             '    width: 10px; //end of line comment\n' +
 2225             '    height: 10px; //another\n' +
 2226             '}\n' +
 2227             '.div {\n' +
 2228             '    height: 15px;\n' +
 2229             '}')
 2230         t(
 2231             '#foo {background-image: url(foo@2x.png);    @font-face {        font-family: "Bitstream Vera Serif Bold";        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");    }}.div{height:15px;}',
 2232             #  -- output --
 2233             '#foo {\n' +
 2234             '    background-image: url(foo@2x.png);\n' +
 2235             '    @font-face {\n' +
 2236             '        font-family: "Bitstream Vera Serif Bold";\n' +
 2237             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2238             '    }\n' +
 2239             '}\n' +
 2240             '.div {\n' +
 2241             '    height: 15px;\n' +
 2242             '}')
 2243         t(
 2244             '@media screen {    #foo:hover {        background-image: url(foo@2x.png);    }    @font-face {        font-family: "Bitstream Vera Serif Bold";        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");    }}.div{height:15px;}',
 2245             #  -- output --
 2246             '@media screen {\n' +
 2247             '    #foo:hover {\n' +
 2248             '        background-image: url(foo@2x.png);\n' +
 2249             '    }\n' +
 2250             '    @font-face {\n' +
 2251             '        font-family: "Bitstream Vera Serif Bold";\n' +
 2252             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2253             '    }\n' +
 2254             '}\n' +
 2255             '.div {\n' +
 2256             '    height: 15px;\n' +
 2257             '}')
 2258         t(
 2259             '@font-face {    font-family: "Bitstream Vera Serif Bold";    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");}\n' +
 2260             '@media screen {    #foo:hover {        background-image: url(foo.png);    }    @media screen and (min-device-pixel-ratio: 2) {        @font-face {            font-family: "Helvetica Neue";        }        #foo:hover {            background-image: url(foo@2x.png);        }    }}',
 2261             #  -- output --
 2262             '@font-face {\n' +
 2263             '    font-family: "Bitstream Vera Serif Bold";\n' +
 2264             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2265             '}\n' +
 2266             '@media screen {\n' +
 2267             '    #foo:hover {\n' +
 2268             '        background-image: url(foo.png);\n' +
 2269             '    }\n' +
 2270             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 2271             '        @font-face {\n' +
 2272             '            font-family: "Helvetica Neue";\n' +
 2273             '        }\n' +
 2274             '        #foo:hover {\n' +
 2275             '            background-image: url(foo@2x.png);\n' +
 2276             '        }\n' +
 2277             '    }\n' +
 2278             '}')
 2279         t(
 2280             'a:first-child{color:red;div:first-child{color:black;}}.div{height:15px;}',
 2281             #  -- output --
 2282             'a:first-child {\n' +
 2283             '    color: red;\n' +
 2284             '    div:first-child {\n' +
 2285             '        color: black;\n' +
 2286             '    }\n' +
 2287             '}\n' +
 2288             '.div {\n' +
 2289             '    height: 15px;\n' +
 2290             '}')
 2291         t(
 2292             'a:first-child{color:red;div:not(.peq){color:black;}}.div{height:15px;}',
 2293             #  -- output --
 2294             'a:first-child {\n' +
 2295             '    color: red;\n' +
 2296             '    div:not(.peq) {\n' +
 2297             '        color: black;\n' +
 2298             '    }\n' +
 2299             '}\n' +
 2300             '.div {\n' +
 2301             '    height: 15px;\n' +
 2302             '}')
 2303 
 2304         # Comments - (preserve_newlines = "false", newline_between_rules = "false")
 2305         self.reset_options()
 2306         self.options.preserve_newlines = false
 2307         self.options.newline_between_rules = false
 2308         t('/* header comment newlines on */')
 2309         t(
 2310             '@import "custom.css";\n' +
 2311             '\n' +
 2312             '\n' +
 2313             '.rule{}',
 2314             #  -- output --
 2315             '@import "custom.css";\n' +
 2316             '.rule {}')
 2317         t(
 2318             '.tabs{\n' +
 2319             '\n' +
 2320             '\n' +
 2321             '/* test */\n' +
 2322             '\n' +
 2323             '\n' +
 2324             '}',
 2325             #  -- output --
 2326             '.tabs {\n' +
 2327             '    /* test */\n' +
 2328             '}')
 2329         
 2330         # #1185
 2331         t(
 2332             '/* header */\n' +
 2333             '\n' +
 2334             '\n' +
 2335             '.tabs{}',
 2336             #  -- output --
 2337             '/* header */\n' +
 2338             '.tabs {}')
 2339         t(
 2340             '.tabs {\n' +
 2341             '\n' +
 2342             '\n' +
 2343             '/* non-header */\n' +
 2344             '\n' +
 2345             '\n' +
 2346             'width:10px;\n' +
 2347             '\n' +
 2348             '\n' +
 2349             '}',
 2350             #  -- output --
 2351             '.tabs {\n' +
 2352             '    /* non-header */\n' +
 2353             '    width: 10px;\n' +
 2354             '}')
 2355         t('/* header')
 2356         t('// comment')
 2357         t('/*')
 2358         t('//')
 2359         t(
 2360             '.selector1 {\n' +
 2361             '\n' +
 2362             '\n' +
 2363             'margin: 0;\n' +
 2364             '\n' +
 2365             '\n' +
 2366             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 2367             '\n' +
 2368             '\n' +
 2369             '}',
 2370             #  -- output --
 2371             '.selector1 {\n' +
 2372             '    margin: 0;\n' +
 2373             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 2374             '}')
 2375         
 2376         # single line comment support (less/sass)
 2377         t(
 2378             '.tabs{\n' +
 2379             '\n' +
 2380             '\n' +
 2381             '// comment\n' +
 2382             '\n' +
 2383             '\n' +
 2384             'width:10px;\n' +
 2385             '\n' +
 2386             '\n' +
 2387             '}',
 2388             #  -- output --
 2389             '.tabs {\n' +
 2390             '    // comment\n' +
 2391             '    width: 10px;\n' +
 2392             '}')
 2393         t(
 2394             '.tabs{\n' +
 2395             '\n' +
 2396             '\n' +
 2397             '// comment\n' +
 2398             '\n' +
 2399             '\n' +
 2400             'width:10px;\n' +
 2401             '\n' +
 2402             '\n' +
 2403             '}',
 2404             #  -- output --
 2405             '.tabs {\n' +
 2406             '    // comment\n' +
 2407             '    width: 10px;\n' +
 2408             '}')
 2409         t(
 2410             '//comment\n' +
 2411             '\n' +
 2412             '\n' +
 2413             '.tabs{\n' +
 2414             '\n' +
 2415             '\n' +
 2416             'width:10px;\n' +
 2417             '\n' +
 2418             '\n' +
 2419             '}',
 2420             #  -- output --
 2421             '//comment\n' +
 2422             '.tabs {\n' +
 2423             '    width: 10px;\n' +
 2424             '}')
 2425         t(
 2426             '.tabs{\n' +
 2427             '\n' +
 2428             '\n' +
 2429             '//comment\n' +
 2430             '\n' +
 2431             '\n' +
 2432             '//2nd single line comment\n' +
 2433             '\n' +
 2434             '\n' +
 2435             'width:10px;\n' +
 2436             '\n' +
 2437             '\n' +
 2438             '}',
 2439             #  -- output --
 2440             '.tabs {\n' +
 2441             '    //comment\n' +
 2442             '    //2nd single line comment\n' +
 2443             '    width: 10px;\n' +
 2444             '}')
 2445         t(
 2446             '.tabs{\n' +
 2447             '\n' +
 2448             '\n' +
 2449             'width:10px;//end of line comment\n' +
 2450             '\n' +
 2451             '\n' +
 2452             '}',
 2453             #  -- output --
 2454             '.tabs {\n' +
 2455             '    width: 10px; //end of line comment\n' +
 2456             '}')
 2457         t(
 2458             '.tabs{\n' +
 2459             '\n' +
 2460             '\n' +
 2461             'width:10px;//end of line comment\n' +
 2462             '\n' +
 2463             '\n' +
 2464             'height:10px;\n' +
 2465             '\n' +
 2466             '\n' +
 2467             '}',
 2468             #  -- output --
 2469             '.tabs {\n' +
 2470             '    width: 10px; //end of line comment\n' +
 2471             '    height: 10px;\n' +
 2472             '}')
 2473         t(
 2474             '.tabs{\n' +
 2475             '\n' +
 2476             '\n' +
 2477             'width:10px;//end of line comment\n' +
 2478             '\n' +
 2479             '\n' +
 2480             'height:10px;//another nl\n' +
 2481             '\n' +
 2482             '\n' +
 2483             '}',
 2484             #  -- output --
 2485             '.tabs {\n' +
 2486             '    width: 10px; //end of line comment\n' +
 2487             '    height: 10px; //another nl\n' +
 2488             '}')
 2489         t(
 2490             '.tabs{\n' +
 2491             '\n' +
 2492             '\n' +
 2493             'width: 10px;   // comment follows rule\n' +
 2494             '\n' +
 2495             '\n' +
 2496             '// another comment new line\n' +
 2497             '\n' +
 2498             '\n' +
 2499             '}',
 2500             #  -- output --
 2501             '.tabs {\n' +
 2502             '    width: 10px; // comment follows rule\n' +
 2503             '    // another comment new line\n' +
 2504             '}')
 2505         
 2506         # #1165
 2507         t(
 2508             '.tabs{\n' +
 2509             '\n' +
 2510             '\n' +
 2511             'width: 10px;\n' +
 2512             '\n' +
 2513             '\n' +
 2514             '        // comment follows rule\n' +
 2515             '\n' +
 2516             '\n' +
 2517             '// another comment new line\n' +
 2518             '\n' +
 2519             '\n' +
 2520             '}',
 2521             #  -- output --
 2522             '.tabs {\n' +
 2523             '    width: 10px;\n' +
 2524             '    // comment follows rule\n' +
 2525             '    // another comment new line\n' +
 2526             '}')
 2527         
 2528         # #736
 2529         t(
 2530             '/*\n' +
 2531             ' * comment\n' +
 2532             ' */\n' +
 2533             '\n' +
 2534             '\n' +
 2535             '/* another comment */\n' +
 2536             '\n' +
 2537             '\n' +
 2538             'body{}\n' +
 2539             '\n' +
 2540             '\n',
 2541             #  -- output --
 2542             '/*\n' +
 2543             ' * comment\n' +
 2544             ' */\n' +
 2545             '/* another comment */\n' +
 2546             'body {}')
 2547         
 2548         # #1348
 2549         t(
 2550             '.demoa1 {\n' +
 2551             '\n' +
 2552             '\n' +
 2553             'text-align:left; //demoa1 instructions for LESS note visibility only\n' +
 2554             '\n' +
 2555             '\n' +
 2556             '}\n' +
 2557             '\n' +
 2558             '\n' +
 2559             '.demob {\n' +
 2560             '\n' +
 2561             '\n' +
 2562             'text-align: right;\n' +
 2563             '\n' +
 2564             '\n' +
 2565             '}',
 2566             #  -- output --
 2567             '.demoa1 {\n' +
 2568             '    text-align: left; //demoa1 instructions for LESS note visibility only\n' +
 2569             '}\n' +
 2570             '.demob {\n' +
 2571             '    text-align: right;\n' +
 2572             '}')
 2573         
 2574         # #1440
 2575         t(
 2576             '#search-text {\n' +
 2577             '  width: 43%;\n' +
 2578             '  // height: 100%;\n' +
 2579             '  border: none;\n' +
 2580             '}',
 2581             #  -- output --
 2582             '#search-text {\n' +
 2583             '    width: 43%;\n' +
 2584             '    // height: 100%;\n' +
 2585             '    border: none;\n' +
 2586             '}')
 2587         t(
 2588             '.demoa2 {\n' +
 2589             '\n' +
 2590             '\n' +
 2591             'text-align:left;\n' +
 2592             '\n' +
 2593             '\n' +
 2594             '}\n' +
 2595             '\n' +
 2596             '\n' +
 2597             '//demob instructions for LESS note visibility only\n' +
 2598             '\n' +
 2599             '\n' +
 2600             '.demob {\n' +
 2601             '\n' +
 2602             '\n' +
 2603             'text-align: right}',
 2604             #  -- output --
 2605             '.demoa2 {\n' +
 2606             '    text-align: left;\n' +
 2607             '}\n' +
 2608             '//demob instructions for LESS note visibility only\n' +
 2609             '.demob {\n' +
 2610             '    text-align: right\n' +
 2611             '}')
 2612         
 2613         # new lines between rules - #531 and #857
 2614         t(
 2615             '.div{}\n' +
 2616             '\n' +
 2617             '\n' +
 2618             '.span {\n' +
 2619             '\n' +
 2620             '\n' +
 2621             '}',
 2622             #  -- output --
 2623             '.div {}\n' +
 2624             '.span {}')
 2625         t(
 2626             '/**/\n' +
 2627             '\n' +
 2628             '\n' +
 2629             '/**/\n' +
 2630             '\n' +
 2631             '\n' +
 2632             '//\n' +
 2633             '\n' +
 2634             '\n' +
 2635             '/**/\n' +
 2636             '\n' +
 2637             '\n' +
 2638             '.div{}\n' +
 2639             '\n' +
 2640             '\n' +
 2641             '/**/\n' +
 2642             '\n' +
 2643             '\n' +
 2644             '/**/\n' +
 2645             '\n' +
 2646             '\n' +
 2647             '//\n' +
 2648             '\n' +
 2649             '\n' +
 2650             '/**/\n' +
 2651             '\n' +
 2652             '\n' +
 2653             '.span {\n' +
 2654             '\n' +
 2655             '\n' +
 2656             '}',
 2657             #  -- output --
 2658             '/**/\n' +
 2659             '/**/\n' +
 2660             '//\n' +
 2661             '/**/\n' +
 2662             '.div {}\n' +
 2663             '/**/\n' +
 2664             '/**/\n' +
 2665             '//\n' +
 2666             '/**/\n' +
 2667             '.span {}')
 2668         t(
 2669             '//\n' +
 2670             '\n' +
 2671             '\n' +
 2672             '.div{}\n' +
 2673             '\n' +
 2674             '\n' +
 2675             '//\n' +
 2676             '\n' +
 2677             '\n' +
 2678             '.span {\n' +
 2679             '\n' +
 2680             '\n' +
 2681             '}',
 2682             #  -- output --
 2683             '//\n' +
 2684             '.div {}\n' +
 2685             '//\n' +
 2686             '.span {}')
 2687         t(
 2688             '.selector1 {\n' +
 2689             '\n' +
 2690             '\n' +
 2691             'margin: 0; \n' +
 2692             '\n' +
 2693             '\n' +
 2694             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 2695             '\n' +
 2696             '\n' +
 2697             '}\n' +
 2698             '\n' +
 2699             '\n' +
 2700             '.div{\n' +
 2701             '\n' +
 2702             '\n' +
 2703             'height:15px;\n' +
 2704             '\n' +
 2705             '\n' +
 2706             '}',
 2707             #  -- output --
 2708             '.selector1 {\n' +
 2709             '    margin: 0;\n' +
 2710             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 2711             '}\n' +
 2712             '.div {\n' +
 2713             '    height: 15px;\n' +
 2714             '}')
 2715         t(
 2716             '.tabs{\n' +
 2717             '\n' +
 2718             '\n' +
 2719             'width:10px;//end of line comment\n' +
 2720             '\n' +
 2721             '\n' +
 2722             'height:10px;//another\n' +
 2723             '\n' +
 2724             '\n' +
 2725             '}\n' +
 2726             '\n' +
 2727             '\n' +
 2728             '.div{\n' +
 2729             '\n' +
 2730             '\n' +
 2731             'height:15px;\n' +
 2732             '\n' +
 2733             '\n' +
 2734             '}',
 2735             #  -- output --
 2736             '.tabs {\n' +
 2737             '    width: 10px; //end of line comment\n' +
 2738             '    height: 10px; //another\n' +
 2739             '}\n' +
 2740             '.div {\n' +
 2741             '    height: 15px;\n' +
 2742             '}')
 2743         t(
 2744             '#foo {\n' +
 2745             '\n' +
 2746             '\n' +
 2747             'background-image: url(foo@2x.png);\n' +
 2748             '\n' +
 2749             '\n' +
 2750             '    @font-face {\n' +
 2751             '\n' +
 2752             '\n' +
 2753             '        font-family: "Bitstream Vera Serif Bold";\n' +
 2754             '\n' +
 2755             '\n' +
 2756             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2757             '\n' +
 2758             '\n' +
 2759             '    }\n' +
 2760             '\n' +
 2761             '\n' +
 2762             '}\n' +
 2763             '\n' +
 2764             '\n' +
 2765             '.div{\n' +
 2766             '\n' +
 2767             '\n' +
 2768             'height:15px;\n' +
 2769             '\n' +
 2770             '\n' +
 2771             '}',
 2772             #  -- output --
 2773             '#foo {\n' +
 2774             '    background-image: url(foo@2x.png);\n' +
 2775             '    @font-face {\n' +
 2776             '        font-family: "Bitstream Vera Serif Bold";\n' +
 2777             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2778             '    }\n' +
 2779             '}\n' +
 2780             '.div {\n' +
 2781             '    height: 15px;\n' +
 2782             '}')
 2783         t(
 2784             '@media screen {\n' +
 2785             '\n' +
 2786             '\n' +
 2787             '    #foo:hover {\n' +
 2788             '\n' +
 2789             '\n' +
 2790             '        background-image: url(foo@2x.png);\n' +
 2791             '\n' +
 2792             '\n' +
 2793             '    }\n' +
 2794             '\n' +
 2795             '\n' +
 2796             '    @font-face {\n' +
 2797             '\n' +
 2798             '\n' +
 2799             '        font-family: "Bitstream Vera Serif Bold";\n' +
 2800             '\n' +
 2801             '\n' +
 2802             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2803             '\n' +
 2804             '\n' +
 2805             '    }\n' +
 2806             '\n' +
 2807             '\n' +
 2808             '}\n' +
 2809             '\n' +
 2810             '\n' +
 2811             '.div{\n' +
 2812             '\n' +
 2813             '\n' +
 2814             'height:15px;\n' +
 2815             '\n' +
 2816             '\n' +
 2817             '}',
 2818             #  -- output --
 2819             '@media screen {\n' +
 2820             '    #foo:hover {\n' +
 2821             '        background-image: url(foo@2x.png);\n' +
 2822             '    }\n' +
 2823             '    @font-face {\n' +
 2824             '        font-family: "Bitstream Vera Serif Bold";\n' +
 2825             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2826             '    }\n' +
 2827             '}\n' +
 2828             '.div {\n' +
 2829             '    height: 15px;\n' +
 2830             '}')
 2831         t(
 2832             '@font-face {\n' +
 2833             '\n' +
 2834             '\n' +
 2835             '    font-family: "Bitstream Vera Serif Bold";\n' +
 2836             '\n' +
 2837             '\n' +
 2838             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2839             '\n' +
 2840             '\n' +
 2841             '}\n' +
 2842             '\n' +
 2843             '\n' +
 2844             '@media screen {\n' +
 2845             '\n' +
 2846             '\n' +
 2847             '    #foo:hover {\n' +
 2848             '\n' +
 2849             '\n' +
 2850             '        background-image: url(foo.png);\n' +
 2851             '\n' +
 2852             '\n' +
 2853             '    }\n' +
 2854             '\n' +
 2855             '\n' +
 2856             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 2857             '\n' +
 2858             '\n' +
 2859             '        @font-face {\n' +
 2860             '\n' +
 2861             '\n' +
 2862             '            font-family: "Helvetica Neue";\n' +
 2863             '\n' +
 2864             '\n' +
 2865             '        }\n' +
 2866             '\n' +
 2867             '\n' +
 2868             '        #foo:hover {\n' +
 2869             '\n' +
 2870             '\n' +
 2871             '            background-image: url(foo@2x.png);\n' +
 2872             '\n' +
 2873             '\n' +
 2874             '        }\n' +
 2875             '\n' +
 2876             '\n' +
 2877             '    }\n' +
 2878             '\n' +
 2879             '\n' +
 2880             '}',
 2881             #  -- output --
 2882             '@font-face {\n' +
 2883             '    font-family: "Bitstream Vera Serif Bold";\n' +
 2884             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 2885             '}\n' +
 2886             '@media screen {\n' +
 2887             '    #foo:hover {\n' +
 2888             '        background-image: url(foo.png);\n' +
 2889             '    }\n' +
 2890             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 2891             '        @font-face {\n' +
 2892             '            font-family: "Helvetica Neue";\n' +
 2893             '        }\n' +
 2894             '        #foo:hover {\n' +
 2895             '            background-image: url(foo@2x.png);\n' +
 2896             '        }\n' +
 2897             '    }\n' +
 2898             '}')
 2899         t(
 2900             'a:first-child{\n' +
 2901             '\n' +
 2902             '\n' +
 2903             'color:red;\n' +
 2904             '\n' +
 2905             '\n' +
 2906             'div:first-child{\n' +
 2907             '\n' +
 2908             '\n' +
 2909             'color:black;\n' +
 2910             '\n' +
 2911             '\n' +
 2912             '}\n' +
 2913             '\n' +
 2914             '\n' +
 2915             '}\n' +
 2916             '\n' +
 2917             '\n' +
 2918             '.div{\n' +
 2919             '\n' +
 2920             '\n' +
 2921             'height:15px;\n' +
 2922             '\n' +
 2923             '\n' +
 2924             '}',
 2925             #  -- output --
 2926             'a:first-child {\n' +
 2927             '    color: red;\n' +
 2928             '    div:first-child {\n' +
 2929             '        color: black;\n' +
 2930             '    }\n' +
 2931             '}\n' +
 2932             '.div {\n' +
 2933             '    height: 15px;\n' +
 2934             '}')
 2935         t(
 2936             'a:first-child{\n' +
 2937             '\n' +
 2938             '\n' +
 2939             'color:red;\n' +
 2940             '\n' +
 2941             '\n' +
 2942             'div:not(.peq){\n' +
 2943             '\n' +
 2944             '\n' +
 2945             'color:black;\n' +
 2946             '\n' +
 2947             '\n' +
 2948             '}\n' +
 2949             '\n' +
 2950             '\n' +
 2951             '}\n' +
 2952             '\n' +
 2953             '\n' +
 2954             '.div{\n' +
 2955             '\n' +
 2956             '\n' +
 2957             'height:15px;\n' +
 2958             '\n' +
 2959             '\n' +
 2960             '}',
 2961             #  -- output --
 2962             'a:first-child {\n' +
 2963             '    color: red;\n' +
 2964             '    div:not(.peq) {\n' +
 2965             '        color: black;\n' +
 2966             '    }\n' +
 2967             '}\n' +
 2968             '.div {\n' +
 2969             '    height: 15px;\n' +
 2970             '}')
 2971 
 2972         # Comments - (preserve_newlines = "false", newline_between_rules = "false")
 2973         self.reset_options()
 2974         self.options.preserve_newlines = false
 2975         self.options.newline_between_rules = false
 2976         t('/* header comment newlines on */')
 2977         t(
 2978             '@import "custom.css";\n' +
 2979             '        \n' +
 2980             '    \n' +
 2981             '.rule{}',
 2982             #  -- output --
 2983             '@import "custom.css";\n' +
 2984             '.rule {}')
 2985         t(
 2986             '.tabs{\n' +
 2987             '        \n' +
 2988             '    \n' +
 2989             '/* test */\n' +
 2990             '        \n' +
 2991             '    \n' +
 2992             '}',
 2993             #  -- output --
 2994             '.tabs {\n' +
 2995             '    /* test */\n' +
 2996             '}')
 2997         
 2998         # #1185
 2999         t(
 3000             '/* header */\n' +
 3001             '        \n' +
 3002             '    \n' +
 3003             '.tabs{}',
 3004             #  -- output --
 3005             '/* header */\n' +
 3006             '.tabs {}')
 3007         t(
 3008             '.tabs {\n' +
 3009             '        \n' +
 3010             '    \n' +
 3011             '/* non-header */\n' +
 3012             '        \n' +
 3013             '    \n' +
 3014             'width:10px;\n' +
 3015             '        \n' +
 3016             '    \n' +
 3017             '}',
 3018             #  -- output --
 3019             '.tabs {\n' +
 3020             '    /* non-header */\n' +
 3021             '    width: 10px;\n' +
 3022             '}')
 3023         t('/* header')
 3024         t('// comment')
 3025         t('/*')
 3026         t('//')
 3027         t(
 3028             '.selector1 {\n' +
 3029             '        \n' +
 3030             '    \n' +
 3031             'margin: 0;\n' +
 3032             '        \n' +
 3033             '    \n' +
 3034             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3035             '        \n' +
 3036             '    \n' +
 3037             '}',
 3038             #  -- output --
 3039             '.selector1 {\n' +
 3040             '    margin: 0;\n' +
 3041             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3042             '}')
 3043         
 3044         # single line comment support (less/sass)
 3045         t(
 3046             '.tabs{\n' +
 3047             '        \n' +
 3048             '    \n' +
 3049             '// comment\n' +
 3050             '            \n' +
 3051             '   \n' +
 3052             'width:10px;\n' +
 3053             '        \n' +
 3054             '    \n' +
 3055             '}',
 3056             #  -- output --
 3057             '.tabs {\n' +
 3058             '    // comment\n' +
 3059             '    width: 10px;\n' +
 3060             '}')
 3061         t(
 3062             '.tabs{\n' +
 3063             '        \n' +
 3064             '    \n' +
 3065             '// comment\n' +
 3066             '            \n' +
 3067             '   \n' +
 3068             'width:10px;\n' +
 3069             '        \n' +
 3070             '    \n' +
 3071             '}',
 3072             #  -- output --
 3073             '.tabs {\n' +
 3074             '    // comment\n' +
 3075             '    width: 10px;\n' +
 3076             '}')
 3077         t(
 3078             '//comment\n' +
 3079             '            \n' +
 3080             '   \n' +
 3081             '.tabs{\n' +
 3082             '        \n' +
 3083             '    \n' +
 3084             'width:10px;\n' +
 3085             '        \n' +
 3086             '    \n' +
 3087             '}',
 3088             #  -- output --
 3089             '//comment\n' +
 3090             '.tabs {\n' +
 3091             '    width: 10px;\n' +
 3092             '}')
 3093         t(
 3094             '.tabs{\n' +
 3095             '        \n' +
 3096             '    \n' +
 3097             '//comment\n' +
 3098             '            \n' +
 3099             '   \n' +
 3100             '//2nd single line comment\n' +
 3101             '            \n' +
 3102             '   \n' +
 3103             'width:10px;\n' +
 3104             '        \n' +
 3105             '    \n' +
 3106             '}',
 3107             #  -- output --
 3108             '.tabs {\n' +
 3109             '    //comment\n' +
 3110             '    //2nd single line comment\n' +
 3111             '    width: 10px;\n' +
 3112             '}')
 3113         t(
 3114             '.tabs{\n' +
 3115             '        \n' +
 3116             '    \n' +
 3117             'width:10px;//end of line comment\n' +
 3118             '            \n' +
 3119             '   \n' +
 3120             '}',
 3121             #  -- output --
 3122             '.tabs {\n' +
 3123             '    width: 10px; //end of line comment\n' +
 3124             '}')
 3125         t(
 3126             '.tabs{\n' +
 3127             '        \n' +
 3128             '    \n' +
 3129             'width:10px;//end of line comment\n' +
 3130             '            \n' +
 3131             '   \n' +
 3132             'height:10px;\n' +
 3133             '        \n' +
 3134             '    \n' +
 3135             '}',
 3136             #  -- output --
 3137             '.tabs {\n' +
 3138             '    width: 10px; //end of line comment\n' +
 3139             '    height: 10px;\n' +
 3140             '}')
 3141         t(
 3142             '.tabs{\n' +
 3143             '        \n' +
 3144             '    \n' +
 3145             'width:10px;//end of line comment\n' +
 3146             '            \n' +
 3147             '   \n' +
 3148             'height:10px;//another nl\n' +
 3149             '            \n' +
 3150             '   \n' +
 3151             '}',
 3152             #  -- output --
 3153             '.tabs {\n' +
 3154             '    width: 10px; //end of line comment\n' +
 3155             '    height: 10px; //another nl\n' +
 3156             '}')
 3157         t(
 3158             '.tabs{\n' +
 3159             '        \n' +
 3160             '    \n' +
 3161             'width: 10px;   // comment follows rule\n' +
 3162             '            \n' +
 3163             '   \n' +
 3164             '// another comment new line\n' +
 3165             '            \n' +
 3166             '   \n' +
 3167             '}',
 3168             #  -- output --
 3169             '.tabs {\n' +
 3170             '    width: 10px; // comment follows rule\n' +
 3171             '    // another comment new line\n' +
 3172             '}')
 3173         
 3174         # #1165
 3175         t(
 3176             '.tabs{\n' +
 3177             '        \n' +
 3178             '    \n' +
 3179             'width: 10px;\n' +
 3180             '            \n' +
 3181             '   \n' +
 3182             '        // comment follows rule\n' +
 3183             '            \n' +
 3184             '   \n' +
 3185             '// another comment new line\n' +
 3186             '            \n' +
 3187             '   \n' +
 3188             '}',
 3189             #  -- output --
 3190             '.tabs {\n' +
 3191             '    width: 10px;\n' +
 3192             '    // comment follows rule\n' +
 3193             '    // another comment new line\n' +
 3194             '}')
 3195         
 3196         # #736
 3197         t(
 3198             '/*\n' +
 3199             ' * comment\n' +
 3200             ' */\n' +
 3201             '        \n' +
 3202             '    \n' +
 3203             '/* another comment */\n' +
 3204             '        \n' +
 3205             '    \n' +
 3206             'body{}\n' +
 3207             '        \n' +
 3208             '    \n',
 3209             #  -- output --
 3210             '/*\n' +
 3211             ' * comment\n' +
 3212             ' */\n' +
 3213             '/* another comment */\n' +
 3214             'body {}')
 3215         
 3216         # #1348
 3217         t(
 3218             '.demoa1 {\n' +
 3219             '        \n' +
 3220             '    \n' +
 3221             'text-align:left; //demoa1 instructions for LESS note visibility only\n' +
 3222             '            \n' +
 3223             '   \n' +
 3224             '}\n' +
 3225             '        \n' +
 3226             '    \n' +
 3227             '.demob {\n' +
 3228             '        \n' +
 3229             '    \n' +
 3230             'text-align: right;\n' +
 3231             '        \n' +
 3232             '    \n' +
 3233             '}',
 3234             #  -- output --
 3235             '.demoa1 {\n' +
 3236             '    text-align: left; //demoa1 instructions for LESS note visibility only\n' +
 3237             '}\n' +
 3238             '.demob {\n' +
 3239             '    text-align: right;\n' +
 3240             '}')
 3241         
 3242         # #1440
 3243         t(
 3244             '#search-text {\n' +
 3245             '  width: 43%;\n' +
 3246             '  // height: 100%;\n' +
 3247             '  border: none;\n' +
 3248             '}',
 3249             #  -- output --
 3250             '#search-text {\n' +
 3251             '    width: 43%;\n' +
 3252             '    // height: 100%;\n' +
 3253             '    border: none;\n' +
 3254             '}')
 3255         t(
 3256             '.demoa2 {\n' +
 3257             '        \n' +
 3258             '    \n' +
 3259             'text-align:left;\n' +
 3260             '        \n' +
 3261             '    \n' +
 3262             '}\n' +
 3263             '        \n' +
 3264             '    \n' +
 3265             '//demob instructions for LESS note visibility only\n' +
 3266             '            \n' +
 3267             '   \n' +
 3268             '.demob {\n' +
 3269             '        \n' +
 3270             '    \n' +
 3271             'text-align: right}',
 3272             #  -- output --
 3273             '.demoa2 {\n' +
 3274             '    text-align: left;\n' +
 3275             '}\n' +
 3276             '//demob instructions for LESS note visibility only\n' +
 3277             '.demob {\n' +
 3278             '    text-align: right\n' +
 3279             '}')
 3280         
 3281         # new lines between rules - #531 and #857
 3282         t(
 3283             '.div{}\n' +
 3284             '            \n' +
 3285             '   \n' +
 3286             '.span {\n' +
 3287             '        \n' +
 3288             '    \n' +
 3289             '}',
 3290             #  -- output --
 3291             '.div {}\n' +
 3292             '.span {}')
 3293         t(
 3294             '/**/\n' +
 3295             '        \n' +
 3296             '    \n' +
 3297             '/**/\n' +
 3298             '        \n' +
 3299             '    \n' +
 3300             '//\n' +
 3301             '            \n' +
 3302             '   \n' +
 3303             '/**/\n' +
 3304             '        \n' +
 3305             '    \n' +
 3306             '.div{}\n' +
 3307             '        \n' +
 3308             '    \n' +
 3309             '/**/\n' +
 3310             '        \n' +
 3311             '    \n' +
 3312             '/**/\n' +
 3313             '        \n' +
 3314             '    \n' +
 3315             '//\n' +
 3316             '            \n' +
 3317             '   \n' +
 3318             '/**/\n' +
 3319             '        \n' +
 3320             '    \n' +
 3321             '.span {\n' +
 3322             '        \n' +
 3323             '    \n' +
 3324             '}',
 3325             #  -- output --
 3326             '/**/\n' +
 3327             '/**/\n' +
 3328             '//\n' +
 3329             '/**/\n' +
 3330             '.div {}\n' +
 3331             '/**/\n' +
 3332             '/**/\n' +
 3333             '//\n' +
 3334             '/**/\n' +
 3335             '.span {}')
 3336         t(
 3337             '//\n' +
 3338             '            \n' +
 3339             '   \n' +
 3340             '.div{}\n' +
 3341             '        \n' +
 3342             '    \n' +
 3343             '//\n' +
 3344             '            \n' +
 3345             '   \n' +
 3346             '.span {\n' +
 3347             '        \n' +
 3348             '    \n' +
 3349             '}',
 3350             #  -- output --
 3351             '//\n' +
 3352             '.div {}\n' +
 3353             '//\n' +
 3354             '.span {}')
 3355         t(
 3356             '.selector1 {\n' +
 3357             '        \n' +
 3358             '    \n' +
 3359             'margin: 0; \n' +
 3360             '        \n' +
 3361             '    \n' +
 3362             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3363             '        \n' +
 3364             '    \n' +
 3365             '}\n' +
 3366             '            \n' +
 3367             '   \n' +
 3368             '.div{\n' +
 3369             '        \n' +
 3370             '    \n' +
 3371             'height:15px;\n' +
 3372             '        \n' +
 3373             '    \n' +
 3374             '}',
 3375             #  -- output --
 3376             '.selector1 {\n' +
 3377             '    margin: 0;\n' +
 3378             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3379             '}\n' +
 3380             '.div {\n' +
 3381             '    height: 15px;\n' +
 3382             '}')
 3383         t(
 3384             '.tabs{\n' +
 3385             '        \n' +
 3386             '    \n' +
 3387             'width:10px;//end of line comment\n' +
 3388             '            \n' +
 3389             '   \n' +
 3390             'height:10px;//another\n' +
 3391             '            \n' +
 3392             '   \n' +
 3393             '}\n' +
 3394             '        \n' +
 3395             '    \n' +
 3396             '.div{\n' +
 3397             '        \n' +
 3398             '    \n' +
 3399             'height:15px;\n' +
 3400             '        \n' +
 3401             '    \n' +
 3402             '}',
 3403             #  -- output --
 3404             '.tabs {\n' +
 3405             '    width: 10px; //end of line comment\n' +
 3406             '    height: 10px; //another\n' +
 3407             '}\n' +
 3408             '.div {\n' +
 3409             '    height: 15px;\n' +
 3410             '}')
 3411         t(
 3412             '#foo {\n' +
 3413             '        \n' +
 3414             '    \n' +
 3415             'background-image: url(foo@2x.png);\n' +
 3416             '        \n' +
 3417             '    \n' +
 3418             '    @font-face {\n' +
 3419             '        \n' +
 3420             '    \n' +
 3421             '        font-family: "Bitstream Vera Serif Bold";\n' +
 3422             '        \n' +
 3423             '    \n' +
 3424             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3425             '        \n' +
 3426             '    \n' +
 3427             '    }\n' +
 3428             '        \n' +
 3429             '    \n' +
 3430             '}\n' +
 3431             '        \n' +
 3432             '    \n' +
 3433             '.div{\n' +
 3434             '        \n' +
 3435             '    \n' +
 3436             'height:15px;\n' +
 3437             '        \n' +
 3438             '    \n' +
 3439             '}',
 3440             #  -- output --
 3441             '#foo {\n' +
 3442             '    background-image: url(foo@2x.png);\n' +
 3443             '    @font-face {\n' +
 3444             '        font-family: "Bitstream Vera Serif Bold";\n' +
 3445             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3446             '    }\n' +
 3447             '}\n' +
 3448             '.div {\n' +
 3449             '    height: 15px;\n' +
 3450             '}')
 3451         t(
 3452             '@media screen {\n' +
 3453             '        \n' +
 3454             '    \n' +
 3455             '    #foo:hover {\n' +
 3456             '        \n' +
 3457             '    \n' +
 3458             '        background-image: url(foo@2x.png);\n' +
 3459             '        \n' +
 3460             '    \n' +
 3461             '    }\n' +
 3462             '        \n' +
 3463             '    \n' +
 3464             '    @font-face {\n' +
 3465             '        \n' +
 3466             '    \n' +
 3467             '        font-family: "Bitstream Vera Serif Bold";\n' +
 3468             '        \n' +
 3469             '    \n' +
 3470             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3471             '        \n' +
 3472             '    \n' +
 3473             '    }\n' +
 3474             '        \n' +
 3475             '    \n' +
 3476             '}\n' +
 3477             '        \n' +
 3478             '    \n' +
 3479             '.div{\n' +
 3480             '        \n' +
 3481             '    \n' +
 3482             'height:15px;\n' +
 3483             '        \n' +
 3484             '    \n' +
 3485             '}',
 3486             #  -- output --
 3487             '@media screen {\n' +
 3488             '    #foo:hover {\n' +
 3489             '        background-image: url(foo@2x.png);\n' +
 3490             '    }\n' +
 3491             '    @font-face {\n' +
 3492             '        font-family: "Bitstream Vera Serif Bold";\n' +
 3493             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3494             '    }\n' +
 3495             '}\n' +
 3496             '.div {\n' +
 3497             '    height: 15px;\n' +
 3498             '}')
 3499         t(
 3500             '@font-face {\n' +
 3501             '        \n' +
 3502             '    \n' +
 3503             '    font-family: "Bitstream Vera Serif Bold";\n' +
 3504             '        \n' +
 3505             '    \n' +
 3506             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3507             '        \n' +
 3508             '    \n' +
 3509             '}\n' +
 3510             '            \n' +
 3511             '   \n' +
 3512             '@media screen {\n' +
 3513             '        \n' +
 3514             '    \n' +
 3515             '    #foo:hover {\n' +
 3516             '        \n' +
 3517             '    \n' +
 3518             '        background-image: url(foo.png);\n' +
 3519             '        \n' +
 3520             '    \n' +
 3521             '    }\n' +
 3522             '        \n' +
 3523             '    \n' +
 3524             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 3525             '        \n' +
 3526             '    \n' +
 3527             '        @font-face {\n' +
 3528             '        \n' +
 3529             '    \n' +
 3530             '            font-family: "Helvetica Neue";\n' +
 3531             '        \n' +
 3532             '    \n' +
 3533             '        }\n' +
 3534             '        \n' +
 3535             '    \n' +
 3536             '        #foo:hover {\n' +
 3537             '        \n' +
 3538             '    \n' +
 3539             '            background-image: url(foo@2x.png);\n' +
 3540             '        \n' +
 3541             '    \n' +
 3542             '        }\n' +
 3543             '        \n' +
 3544             '    \n' +
 3545             '    }\n' +
 3546             '        \n' +
 3547             '    \n' +
 3548             '}',
 3549             #  -- output --
 3550             '@font-face {\n' +
 3551             '    font-family: "Bitstream Vera Serif Bold";\n' +
 3552             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3553             '}\n' +
 3554             '@media screen {\n' +
 3555             '    #foo:hover {\n' +
 3556             '        background-image: url(foo.png);\n' +
 3557             '    }\n' +
 3558             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 3559             '        @font-face {\n' +
 3560             '            font-family: "Helvetica Neue";\n' +
 3561             '        }\n' +
 3562             '        #foo:hover {\n' +
 3563             '            background-image: url(foo@2x.png);\n' +
 3564             '        }\n' +
 3565             '    }\n' +
 3566             '}')
 3567         t(
 3568             'a:first-child{\n' +
 3569             '        \n' +
 3570             '    \n' +
 3571             'color:red;\n' +
 3572             '        \n' +
 3573             '    \n' +
 3574             'div:first-child{\n' +
 3575             '        \n' +
 3576             '    \n' +
 3577             'color:black;\n' +
 3578             '        \n' +
 3579             '    \n' +
 3580             '}\n' +
 3581             '        \n' +
 3582             '    \n' +
 3583             '}\n' +
 3584             '        \n' +
 3585             '    \n' +
 3586             '.div{\n' +
 3587             '        \n' +
 3588             '    \n' +
 3589             'height:15px;\n' +
 3590             '        \n' +
 3591             '    \n' +
 3592             '}',
 3593             #  -- output --
 3594             'a:first-child {\n' +
 3595             '    color: red;\n' +
 3596             '    div:first-child {\n' +
 3597             '        color: black;\n' +
 3598             '    }\n' +
 3599             '}\n' +
 3600             '.div {\n' +
 3601             '    height: 15px;\n' +
 3602             '}')
 3603         t(
 3604             'a:first-child{\n' +
 3605             '        \n' +
 3606             '    \n' +
 3607             'color:red;\n' +
 3608             '        \n' +
 3609             '    \n' +
 3610             'div:not(.peq){\n' +
 3611             '        \n' +
 3612             '    \n' +
 3613             'color:black;\n' +
 3614             '        \n' +
 3615             '    \n' +
 3616             '}\n' +
 3617             '        \n' +
 3618             '    \n' +
 3619             '}\n' +
 3620             '        \n' +
 3621             '    \n' +
 3622             '.div{\n' +
 3623             '        \n' +
 3624             '    \n' +
 3625             'height:15px;\n' +
 3626             '        \n' +
 3627             '    \n' +
 3628             '}',
 3629             #  -- output --
 3630             'a:first-child {\n' +
 3631             '    color: red;\n' +
 3632             '    div:not(.peq) {\n' +
 3633             '        color: black;\n' +
 3634             '    }\n' +
 3635             '}\n' +
 3636             '.div {\n' +
 3637             '    height: 15px;\n' +
 3638             '}')
 3639 
 3640         # Comments - (preserve_newlines = "true", newline_between_rules = "false")
 3641         self.reset_options()
 3642         self.options.preserve_newlines = true
 3643         self.options.newline_between_rules = false
 3644         t('/* header comment newlines on */')
 3645         t(
 3646             '@import "custom.css";.rule{}',
 3647             #  -- output --
 3648             '@import "custom.css";\n' +
 3649             '.rule {}')
 3650         t(
 3651             '.tabs{/* test */}',
 3652             #  -- output --
 3653             '.tabs {\n' +
 3654             '    /* test */\n' +
 3655             '}')
 3656         
 3657         # #1185
 3658         t(
 3659             '/* header */.tabs{}',
 3660             #  -- output --
 3661             '/* header */\n' +
 3662             '.tabs {}')
 3663         t(
 3664             '.tabs {/* non-header */width:10px;}',
 3665             #  -- output --
 3666             '.tabs {\n' +
 3667             '    /* non-header */\n' +
 3668             '    width: 10px;\n' +
 3669             '}')
 3670         t('/* header')
 3671         t('// comment')
 3672         t('/*')
 3673         t('//')
 3674         t(
 3675             '.selector1 {margin: 0;/* This is a comment including an url http://domain.com/path/to/file.ext */}',
 3676             #  -- output --
 3677             '.selector1 {\n' +
 3678             '    margin: 0;\n' +
 3679             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3680             '}')
 3681         
 3682         # single line comment support (less/sass)
 3683         t(
 3684             '.tabs{// comment\n' +
 3685             'width:10px;}',
 3686             #  -- output --
 3687             '.tabs {\n' +
 3688             '    // comment\n' +
 3689             '    width: 10px;\n' +
 3690             '}')
 3691         t(
 3692             '.tabs{// comment\n' +
 3693             'width:10px;}',
 3694             #  -- output --
 3695             '.tabs {\n' +
 3696             '    // comment\n' +
 3697             '    width: 10px;\n' +
 3698             '}')
 3699         t(
 3700             '//comment\n' +
 3701             '.tabs{width:10px;}',
 3702             #  -- output --
 3703             '//comment\n' +
 3704             '.tabs {\n' +
 3705             '    width: 10px;\n' +
 3706             '}')
 3707         t(
 3708             '.tabs{//comment\n' +
 3709             '//2nd single line comment\n' +
 3710             'width:10px;}',
 3711             #  -- output --
 3712             '.tabs {\n' +
 3713             '    //comment\n' +
 3714             '    //2nd single line comment\n' +
 3715             '    width: 10px;\n' +
 3716             '}')
 3717         t(
 3718             '.tabs{width:10px;//end of line comment\n' +
 3719             '}',
 3720             #  -- output --
 3721             '.tabs {\n' +
 3722             '    width: 10px; //end of line comment\n' +
 3723             '}')
 3724         t(
 3725             '.tabs{width:10px;//end of line comment\n' +
 3726             'height:10px;}',
 3727             #  -- output --
 3728             '.tabs {\n' +
 3729             '    width: 10px; //end of line comment\n' +
 3730             '    height: 10px;\n' +
 3731             '}')
 3732         t(
 3733             '.tabs{width:10px;//end of line comment\n' +
 3734             'height:10px;//another nl\n' +
 3735             '}',
 3736             #  -- output --
 3737             '.tabs {\n' +
 3738             '    width: 10px; //end of line comment\n' +
 3739             '    height: 10px; //another nl\n' +
 3740             '}')
 3741         t(
 3742             '.tabs{width: 10px;   // comment follows rule\n' +
 3743             '// another comment new line\n' +
 3744             '}',
 3745             #  -- output --
 3746             '.tabs {\n' +
 3747             '    width: 10px; // comment follows rule\n' +
 3748             '    // another comment new line\n' +
 3749             '}')
 3750         
 3751         # #1165
 3752         t(
 3753             '.tabs{width: 10px;\n' +
 3754             '        // comment follows rule\n' +
 3755             '// another comment new line\n' +
 3756             '}',
 3757             #  -- output --
 3758             '.tabs {\n' +
 3759             '    width: 10px;\n' +
 3760             '    // comment follows rule\n' +
 3761             '    // another comment new line\n' +
 3762             '}')
 3763         
 3764         # #736
 3765         t(
 3766             '/*\n' +
 3767             ' * comment\n' +
 3768             ' *//* another comment */body{}',
 3769             #  -- output --
 3770             '/*\n' +
 3771             ' * comment\n' +
 3772             ' */\n' +
 3773             '/* another comment */\n' +
 3774             'body {}')
 3775         
 3776         # #1348
 3777         t(
 3778             '.demoa1 {text-align:left; //demoa1 instructions for LESS note visibility only\n' +
 3779             '}.demob {text-align: right;}',
 3780             #  -- output --
 3781             '.demoa1 {\n' +
 3782             '    text-align: left; //demoa1 instructions for LESS note visibility only\n' +
 3783             '}\n' +
 3784             '.demob {\n' +
 3785             '    text-align: right;\n' +
 3786             '}')
 3787         
 3788         # #1440
 3789         t(
 3790             '#search-text {\n' +
 3791             '  width: 43%;\n' +
 3792             '  // height: 100%;\n' +
 3793             '  border: none;\n' +
 3794             '}',
 3795             #  -- output --
 3796             '#search-text {\n' +
 3797             '    width: 43%;\n' +
 3798             '    // height: 100%;\n' +
 3799             '    border: none;\n' +
 3800             '}')
 3801         t(
 3802             '.demoa2 {text-align:left;}//demob instructions for LESS note visibility only\n' +
 3803             '.demob {text-align: right}',
 3804             #  -- output --
 3805             '.demoa2 {\n' +
 3806             '    text-align: left;\n' +
 3807             '}\n' +
 3808             '//demob instructions for LESS note visibility only\n' +
 3809             '.demob {\n' +
 3810             '    text-align: right\n' +
 3811             '}')
 3812         
 3813         # new lines between rules - #531 and #857
 3814         t(
 3815             '.div{}\n' +
 3816             '.span {}',
 3817             #  -- output --
 3818             '.div {}\n' +
 3819             '.span {}')
 3820         t(
 3821             '/**//**///\n' +
 3822             '/**/.div{}/**//**///\n' +
 3823             '/**/.span {}',
 3824             #  -- output --
 3825             '/**/\n' +
 3826             '/**/\n' +
 3827             '//\n' +
 3828             '/**/\n' +
 3829             '.div {}\n' +
 3830             '/**/\n' +
 3831             '/**/\n' +
 3832             '//\n' +
 3833             '/**/\n' +
 3834             '.span {}')
 3835         t(
 3836             '//\n' +
 3837             '.div{}//\n' +
 3838             '.span {}',
 3839             #  -- output --
 3840             '//\n' +
 3841             '.div {}\n' +
 3842             '//\n' +
 3843             '.span {}')
 3844         t(
 3845             '.selector1 {margin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */}\n' +
 3846             '.div{height:15px;}',
 3847             #  -- output --
 3848             '.selector1 {\n' +
 3849             '    margin: 0;\n' +
 3850             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3851             '}\n' +
 3852             '.div {\n' +
 3853             '    height: 15px;\n' +
 3854             '}')
 3855         t(
 3856             '.tabs{width:10px;//end of line comment\n' +
 3857             'height:10px;//another\n' +
 3858             '}.div{height:15px;}',
 3859             #  -- output --
 3860             '.tabs {\n' +
 3861             '    width: 10px; //end of line comment\n' +
 3862             '    height: 10px; //another\n' +
 3863             '}\n' +
 3864             '.div {\n' +
 3865             '    height: 15px;\n' +
 3866             '}')
 3867         t(
 3868             '#foo {background-image: url(foo@2x.png);    @font-face {        font-family: "Bitstream Vera Serif Bold";        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");    }}.div{height:15px;}',
 3869             #  -- output --
 3870             '#foo {\n' +
 3871             '    background-image: url(foo@2x.png);\n' +
 3872             '    @font-face {\n' +
 3873             '        font-family: "Bitstream Vera Serif Bold";\n' +
 3874             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3875             '    }\n' +
 3876             '}\n' +
 3877             '.div {\n' +
 3878             '    height: 15px;\n' +
 3879             '}')
 3880         t(
 3881             '@media screen {    #foo:hover {        background-image: url(foo@2x.png);    }    @font-face {        font-family: "Bitstream Vera Serif Bold";        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");    }}.div{height:15px;}',
 3882             #  -- output --
 3883             '@media screen {\n' +
 3884             '    #foo:hover {\n' +
 3885             '        background-image: url(foo@2x.png);\n' +
 3886             '    }\n' +
 3887             '    @font-face {\n' +
 3888             '        font-family: "Bitstream Vera Serif Bold";\n' +
 3889             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3890             '    }\n' +
 3891             '}\n' +
 3892             '.div {\n' +
 3893             '    height: 15px;\n' +
 3894             '}')
 3895         t(
 3896             '@font-face {    font-family: "Bitstream Vera Serif Bold";    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");}\n' +
 3897             '@media screen {    #foo:hover {        background-image: url(foo.png);    }    @media screen and (min-device-pixel-ratio: 2) {        @font-face {            font-family: "Helvetica Neue";        }        #foo:hover {            background-image: url(foo@2x.png);        }    }}',
 3898             #  -- output --
 3899             '@font-face {\n' +
 3900             '    font-family: "Bitstream Vera Serif Bold";\n' +
 3901             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 3902             '}\n' +
 3903             '@media screen {\n' +
 3904             '    #foo:hover {\n' +
 3905             '        background-image: url(foo.png);\n' +
 3906             '    }\n' +
 3907             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 3908             '        @font-face {\n' +
 3909             '            font-family: "Helvetica Neue";\n' +
 3910             '        }\n' +
 3911             '        #foo:hover {\n' +
 3912             '            background-image: url(foo@2x.png);\n' +
 3913             '        }\n' +
 3914             '    }\n' +
 3915             '}')
 3916         t(
 3917             'a:first-child{color:red;div:first-child{color:black;}}.div{height:15px;}',
 3918             #  -- output --
 3919             'a:first-child {\n' +
 3920             '    color: red;\n' +
 3921             '    div:first-child {\n' +
 3922             '        color: black;\n' +
 3923             '    }\n' +
 3924             '}\n' +
 3925             '.div {\n' +
 3926             '    height: 15px;\n' +
 3927             '}')
 3928         t(
 3929             'a:first-child{color:red;div:not(.peq){color:black;}}.div{height:15px;}',
 3930             #  -- output --
 3931             'a:first-child {\n' +
 3932             '    color: red;\n' +
 3933             '    div:not(.peq) {\n' +
 3934             '        color: black;\n' +
 3935             '    }\n' +
 3936             '}\n' +
 3937             '.div {\n' +
 3938             '    height: 15px;\n' +
 3939             '}')
 3940 
 3941         # Comments - (preserve_newlines = "true", newline_between_rules = "false")
 3942         self.reset_options()
 3943         self.options.preserve_newlines = true
 3944         self.options.newline_between_rules = false
 3945         t('/* header comment newlines on */')
 3946         t(
 3947             '@import "custom.css";\n' +
 3948             '.rule{}',
 3949             #  -- output --
 3950             '@import "custom.css";\n' +
 3951             '.rule {}')
 3952         t(
 3953             '.tabs{\n' +
 3954             '/* test */\n' +
 3955             '}',
 3956             #  -- output --
 3957             '.tabs {\n' +
 3958             '    /* test */\n' +
 3959             '}')
 3960         
 3961         # #1185
 3962         t(
 3963             '/* header */\n' +
 3964             '.tabs{}',
 3965             #  -- output --
 3966             '/* header */\n' +
 3967             '.tabs {}')
 3968         t(
 3969             '.tabs {\n' +
 3970             '/* non-header */\n' +
 3971             'width:10px;\n' +
 3972             '}',
 3973             #  -- output --
 3974             '.tabs {\n' +
 3975             '    /* non-header */\n' +
 3976             '    width: 10px;\n' +
 3977             '}')
 3978         t('/* header')
 3979         t('// comment')
 3980         t('/*')
 3981         t('//')
 3982         t(
 3983             '.selector1 {\n' +
 3984             'margin: 0;\n' +
 3985             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3986             '}',
 3987             #  -- output --
 3988             '.selector1 {\n' +
 3989             '    margin: 0;\n' +
 3990             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 3991             '}')
 3992         
 3993         # single line comment support (less/sass)
 3994         t(
 3995             '.tabs{\n' +
 3996             '// comment\n' +
 3997             'width:10px;\n' +
 3998             '}',
 3999             #  -- output --
 4000             '.tabs {\n' +
 4001             '    // comment\n' +
 4002             '    width: 10px;\n' +
 4003             '}')
 4004         t(
 4005             '.tabs{\n' +
 4006             '// comment\n' +
 4007             'width:10px;\n' +
 4008             '}',
 4009             #  -- output --
 4010             '.tabs {\n' +
 4011             '    // comment\n' +
 4012             '    width: 10px;\n' +
 4013             '}')
 4014         t(
 4015             '//comment\n' +
 4016             '.tabs{\n' +
 4017             'width:10px;\n' +
 4018             '}',
 4019             #  -- output --
 4020             '//comment\n' +
 4021             '.tabs {\n' +
 4022             '    width: 10px;\n' +
 4023             '}')
 4024         t(
 4025             '.tabs{\n' +
 4026             '//comment\n' +
 4027             '//2nd single line comment\n' +
 4028             'width:10px;\n' +
 4029             '}',
 4030             #  -- output --
 4031             '.tabs {\n' +
 4032             '    //comment\n' +
 4033             '    //2nd single line comment\n' +
 4034             '    width: 10px;\n' +
 4035             '}')
 4036         t(
 4037             '.tabs{\n' +
 4038             'width:10px;//end of line comment\n' +
 4039             '}',
 4040             #  -- output --
 4041             '.tabs {\n' +
 4042             '    width: 10px; //end of line comment\n' +
 4043             '}')
 4044         t(
 4045             '.tabs{\n' +
 4046             'width:10px;//end of line comment\n' +
 4047             'height:10px;\n' +
 4048             '}',
 4049             #  -- output --
 4050             '.tabs {\n' +
 4051             '    width: 10px; //end of line comment\n' +
 4052             '    height: 10px;\n' +
 4053             '}')
 4054         t(
 4055             '.tabs{\n' +
 4056             'width:10px;//end of line comment\n' +
 4057             'height:10px;//another nl\n' +
 4058             '}',
 4059             #  -- output --
 4060             '.tabs {\n' +
 4061             '    width: 10px; //end of line comment\n' +
 4062             '    height: 10px; //another nl\n' +
 4063             '}')
 4064         t(
 4065             '.tabs{\n' +
 4066             'width: 10px;   // comment follows rule\n' +
 4067             '// another comment new line\n' +
 4068             '}',
 4069             #  -- output --
 4070             '.tabs {\n' +
 4071             '    width: 10px; // comment follows rule\n' +
 4072             '    // another comment new line\n' +
 4073             '}')
 4074         
 4075         # #1165
 4076         t(
 4077             '.tabs{\n' +
 4078             'width: 10px;\n' +
 4079             '        // comment follows rule\n' +
 4080             '// another comment new line\n' +
 4081             '}',
 4082             #  -- output --
 4083             '.tabs {\n' +
 4084             '    width: 10px;\n' +
 4085             '    // comment follows rule\n' +
 4086             '    // another comment new line\n' +
 4087             '}')
 4088         
 4089         # #736
 4090         t(
 4091             '/*\n' +
 4092             ' * comment\n' +
 4093             ' */\n' +
 4094             '/* another comment */\n' +
 4095             'body{}\n',
 4096             #  -- output --
 4097             '/*\n' +
 4098             ' * comment\n' +
 4099             ' */\n' +
 4100             '/* another comment */\n' +
 4101             'body {}')
 4102         
 4103         # #1348
 4104         t(
 4105             '.demoa1 {\n' +
 4106             'text-align:left; //demoa1 instructions for LESS note visibility only\n' +
 4107             '}\n' +
 4108             '.demob {\n' +
 4109             'text-align: right;\n' +
 4110             '}',
 4111             #  -- output --
 4112             '.demoa1 {\n' +
 4113             '    text-align: left; //demoa1 instructions for LESS note visibility only\n' +
 4114             '}\n' +
 4115             '.demob {\n' +
 4116             '    text-align: right;\n' +
 4117             '}')
 4118         
 4119         # #1440
 4120         t(
 4121             '#search-text {\n' +
 4122             '  width: 43%;\n' +
 4123             '  // height: 100%;\n' +
 4124             '  border: none;\n' +
 4125             '}',
 4126             #  -- output --
 4127             '#search-text {\n' +
 4128             '    width: 43%;\n' +
 4129             '    // height: 100%;\n' +
 4130             '    border: none;\n' +
 4131             '}')
 4132         t(
 4133             '.demoa2 {\n' +
 4134             'text-align:left;\n' +
 4135             '}\n' +
 4136             '//demob instructions for LESS note visibility only\n' +
 4137             '.demob {\n' +
 4138             'text-align: right}',
 4139             #  -- output --
 4140             '.demoa2 {\n' +
 4141             '    text-align: left;\n' +
 4142             '}\n' +
 4143             '//demob instructions for LESS note visibility only\n' +
 4144             '.demob {\n' +
 4145             '    text-align: right\n' +
 4146             '}')
 4147         
 4148         # new lines between rules - #531 and #857
 4149         t(
 4150             '.div{}\n' +
 4151             '.span {\n' +
 4152             '}',
 4153             #  -- output --
 4154             '.div {}\n' +
 4155             '.span {}')
 4156         t(
 4157             '/**/\n' +
 4158             '/**/\n' +
 4159             '//\n' +
 4160             '/**/\n' +
 4161             '.div{}\n' +
 4162             '/**/\n' +
 4163             '/**/\n' +
 4164             '//\n' +
 4165             '/**/\n' +
 4166             '.span {\n' +
 4167             '}',
 4168             #  -- output --
 4169             '/**/\n' +
 4170             '/**/\n' +
 4171             '//\n' +
 4172             '/**/\n' +
 4173             '.div {}\n' +
 4174             '/**/\n' +
 4175             '/**/\n' +
 4176             '//\n' +
 4177             '/**/\n' +
 4178             '.span {}')
 4179         t(
 4180             '//\n' +
 4181             '.div{}\n' +
 4182             '//\n' +
 4183             '.span {\n' +
 4184             '}',
 4185             #  -- output --
 4186             '//\n' +
 4187             '.div {}\n' +
 4188             '//\n' +
 4189             '.span {}')
 4190         t(
 4191             '.selector1 {\n' +
 4192             'margin: 0; \n' +
 4193             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 4194             '}\n' +
 4195             '.div{\n' +
 4196             'height:15px;\n' +
 4197             '}',
 4198             #  -- output --
 4199             '.selector1 {\n' +
 4200             '    margin: 0;\n' +
 4201             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 4202             '}\n' +
 4203             '.div {\n' +
 4204             '    height: 15px;\n' +
 4205             '}')
 4206         t(
 4207             '.tabs{\n' +
 4208             'width:10px;//end of line comment\n' +
 4209             'height:10px;//another\n' +
 4210             '}\n' +
 4211             '.div{\n' +
 4212             'height:15px;\n' +
 4213             '}',
 4214             #  -- output --
 4215             '.tabs {\n' +
 4216             '    width: 10px; //end of line comment\n' +
 4217             '    height: 10px; //another\n' +
 4218             '}\n' +
 4219             '.div {\n' +
 4220             '    height: 15px;\n' +
 4221             '}')
 4222         t(
 4223             '#foo {\n' +
 4224             'background-image: url(foo@2x.png);\n' +
 4225             '    @font-face {\n' +
 4226             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4227             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4228             '    }\n' +
 4229             '}\n' +
 4230             '.div{\n' +
 4231             'height:15px;\n' +
 4232             '}',
 4233             #  -- output --
 4234             '#foo {\n' +
 4235             '    background-image: url(foo@2x.png);\n' +
 4236             '    @font-face {\n' +
 4237             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4238             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4239             '    }\n' +
 4240             '}\n' +
 4241             '.div {\n' +
 4242             '    height: 15px;\n' +
 4243             '}')
 4244         t(
 4245             '@media screen {\n' +
 4246             '    #foo:hover {\n' +
 4247             '        background-image: url(foo@2x.png);\n' +
 4248             '    }\n' +
 4249             '    @font-face {\n' +
 4250             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4251             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4252             '    }\n' +
 4253             '}\n' +
 4254             '.div{\n' +
 4255             'height:15px;\n' +
 4256             '}',
 4257             #  -- output --
 4258             '@media screen {\n' +
 4259             '    #foo:hover {\n' +
 4260             '        background-image: url(foo@2x.png);\n' +
 4261             '    }\n' +
 4262             '    @font-face {\n' +
 4263             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4264             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4265             '    }\n' +
 4266             '}\n' +
 4267             '.div {\n' +
 4268             '    height: 15px;\n' +
 4269             '}')
 4270         t(
 4271             '@font-face {\n' +
 4272             '    font-family: "Bitstream Vera Serif Bold";\n' +
 4273             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4274             '}\n' +
 4275             '@media screen {\n' +
 4276             '    #foo:hover {\n' +
 4277             '        background-image: url(foo.png);\n' +
 4278             '    }\n' +
 4279             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 4280             '        @font-face {\n' +
 4281             '            font-family: "Helvetica Neue";\n' +
 4282             '        }\n' +
 4283             '        #foo:hover {\n' +
 4284             '            background-image: url(foo@2x.png);\n' +
 4285             '        }\n' +
 4286             '    }\n' +
 4287             '}')
 4288         t(
 4289             'a:first-child{\n' +
 4290             'color:red;\n' +
 4291             'div:first-child{\n' +
 4292             'color:black;\n' +
 4293             '}\n' +
 4294             '}\n' +
 4295             '.div{\n' +
 4296             'height:15px;\n' +
 4297             '}',
 4298             #  -- output --
 4299             'a:first-child {\n' +
 4300             '    color: red;\n' +
 4301             '    div:first-child {\n' +
 4302             '        color: black;\n' +
 4303             '    }\n' +
 4304             '}\n' +
 4305             '.div {\n' +
 4306             '    height: 15px;\n' +
 4307             '}')
 4308         t(
 4309             'a:first-child{\n' +
 4310             'color:red;\n' +
 4311             'div:not(.peq){\n' +
 4312             'color:black;\n' +
 4313             '}\n' +
 4314             '}\n' +
 4315             '.div{\n' +
 4316             'height:15px;\n' +
 4317             '}',
 4318             #  -- output --
 4319             'a:first-child {\n' +
 4320             '    color: red;\n' +
 4321             '    div:not(.peq) {\n' +
 4322             '        color: black;\n' +
 4323             '    }\n' +
 4324             '}\n' +
 4325             '.div {\n' +
 4326             '    height: 15px;\n' +
 4327             '}')
 4328 
 4329         # Comments - (preserve_newlines = "true", newline_between_rules = "false")
 4330         self.reset_options()
 4331         self.options.preserve_newlines = true
 4332         self.options.newline_between_rules = false
 4333         t('/* header comment newlines on */')
 4334         t(
 4335             '@import "custom.css";\n' +
 4336             '        \n' +
 4337             '    \n' +
 4338             '.rule{}',
 4339             #  -- output --
 4340             '@import "custom.css";\n' +
 4341             '\n' +
 4342             '\n' +
 4343             '.rule {}')
 4344         t(
 4345             '.tabs{\n' +
 4346             '        \n' +
 4347             '    \n' +
 4348             '/* test */\n' +
 4349             '        \n' +
 4350             '    \n' +
 4351             '}',
 4352             #  -- output --
 4353             '.tabs {\n' +
 4354             '\n' +
 4355             '\n' +
 4356             '    /* test */\n' +
 4357             '\n' +
 4358             '\n' +
 4359             '}')
 4360         
 4361         # #1185
 4362         t(
 4363             '/* header */\n' +
 4364             '        \n' +
 4365             '    \n' +
 4366             '.tabs{}',
 4367             #  -- output --
 4368             '/* header */\n' +
 4369             '\n' +
 4370             '\n' +
 4371             '.tabs {}')
 4372         t(
 4373             '.tabs {\n' +
 4374             '        \n' +
 4375             '    \n' +
 4376             '/* non-header */\n' +
 4377             '        \n' +
 4378             '    \n' +
 4379             'width:10px;\n' +
 4380             '        \n' +
 4381             '    \n' +
 4382             '}',
 4383             #  -- output --
 4384             '.tabs {\n' +
 4385             '\n' +
 4386             '\n' +
 4387             '    /* non-header */\n' +
 4388             '\n' +
 4389             '\n' +
 4390             '    width: 10px;\n' +
 4391             '\n' +
 4392             '\n' +
 4393             '}')
 4394         t('/* header')
 4395         t('// comment')
 4396         t('/*')
 4397         t('//')
 4398         t(
 4399             '.selector1 {\n' +
 4400             '        \n' +
 4401             '    \n' +
 4402             'margin: 0;\n' +
 4403             '        \n' +
 4404             '    \n' +
 4405             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 4406             '        \n' +
 4407             '    \n' +
 4408             '}',
 4409             #  -- output --
 4410             '.selector1 {\n' +
 4411             '\n' +
 4412             '\n' +
 4413             '    margin: 0;\n' +
 4414             '\n' +
 4415             '\n' +
 4416             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 4417             '\n' +
 4418             '\n' +
 4419             '}')
 4420         
 4421         # single line comment support (less/sass)
 4422         t(
 4423             '.tabs{\n' +
 4424             '        \n' +
 4425             '    \n' +
 4426             '// comment\n' +
 4427             '            \n' +
 4428             '   \n' +
 4429             'width:10px;\n' +
 4430             '        \n' +
 4431             '    \n' +
 4432             '}',
 4433             #  -- output --
 4434             '.tabs {\n' +
 4435             '\n' +
 4436             '\n' +
 4437             '    // comment\n' +
 4438             '\n' +
 4439             '\n' +
 4440             '    width: 10px;\n' +
 4441             '\n' +
 4442             '\n' +
 4443             '}')
 4444         t(
 4445             '.tabs{\n' +
 4446             '        \n' +
 4447             '    \n' +
 4448             '// comment\n' +
 4449             '            \n' +
 4450             '   \n' +
 4451             'width:10px;\n' +
 4452             '        \n' +
 4453             '    \n' +
 4454             '}',
 4455             #  -- output --
 4456             '.tabs {\n' +
 4457             '\n' +
 4458             '\n' +
 4459             '    // comment\n' +
 4460             '\n' +
 4461             '\n' +
 4462             '    width: 10px;\n' +
 4463             '\n' +
 4464             '\n' +
 4465             '}')
 4466         t(
 4467             '//comment\n' +
 4468             '            \n' +
 4469             '   \n' +
 4470             '.tabs{\n' +
 4471             '        \n' +
 4472             '    \n' +
 4473             'width:10px;\n' +
 4474             '        \n' +
 4475             '    \n' +
 4476             '}',
 4477             #  -- output --
 4478             '//comment\n' +
 4479             '\n' +
 4480             '\n' +
 4481             '.tabs {\n' +
 4482             '\n' +
 4483             '\n' +
 4484             '    width: 10px;\n' +
 4485             '\n' +
 4486             '\n' +
 4487             '}')
 4488         t(
 4489             '.tabs{\n' +
 4490             '        \n' +
 4491             '    \n' +
 4492             '//comment\n' +
 4493             '            \n' +
 4494             '   \n' +
 4495             '//2nd single line comment\n' +
 4496             '            \n' +
 4497             '   \n' +
 4498             'width:10px;\n' +
 4499             '        \n' +
 4500             '    \n' +
 4501             '}',
 4502             #  -- output --
 4503             '.tabs {\n' +
 4504             '\n' +
 4505             '\n' +
 4506             '    //comment\n' +
 4507             '\n' +
 4508             '\n' +
 4509             '    //2nd single line comment\n' +
 4510             '\n' +
 4511             '\n' +
 4512             '    width: 10px;\n' +
 4513             '\n' +
 4514             '\n' +
 4515             '}')
 4516         t(
 4517             '.tabs{\n' +
 4518             '        \n' +
 4519             '    \n' +
 4520             'width:10px;//end of line comment\n' +
 4521             '            \n' +
 4522             '   \n' +
 4523             '}',
 4524             #  -- output --
 4525             '.tabs {\n' +
 4526             '\n' +
 4527             '\n' +
 4528             '    width: 10px; //end of line comment\n' +
 4529             '\n' +
 4530             '\n' +
 4531             '}')
 4532         t(
 4533             '.tabs{\n' +
 4534             '        \n' +
 4535             '    \n' +
 4536             'width:10px;//end of line comment\n' +
 4537             '            \n' +
 4538             '   \n' +
 4539             'height:10px;\n' +
 4540             '        \n' +
 4541             '    \n' +
 4542             '}',
 4543             #  -- output --
 4544             '.tabs {\n' +
 4545             '\n' +
 4546             '\n' +
 4547             '    width: 10px; //end of line comment\n' +
 4548             '\n' +
 4549             '\n' +
 4550             '    height: 10px;\n' +
 4551             '\n' +
 4552             '\n' +
 4553             '}')
 4554         t(
 4555             '.tabs{\n' +
 4556             '        \n' +
 4557             '    \n' +
 4558             'width:10px;//end of line comment\n' +
 4559             '            \n' +
 4560             '   \n' +
 4561             'height:10px;//another nl\n' +
 4562             '            \n' +
 4563             '   \n' +
 4564             '}',
 4565             #  -- output --
 4566             '.tabs {\n' +
 4567             '\n' +
 4568             '\n' +
 4569             '    width: 10px; //end of line comment\n' +
 4570             '\n' +
 4571             '\n' +
 4572             '    height: 10px; //another nl\n' +
 4573             '\n' +
 4574             '\n' +
 4575             '}')
 4576         t(
 4577             '.tabs{\n' +
 4578             '        \n' +
 4579             '    \n' +
 4580             'width: 10px;   // comment follows rule\n' +
 4581             '            \n' +
 4582             '   \n' +
 4583             '// another comment new line\n' +
 4584             '            \n' +
 4585             '   \n' +
 4586             '}',
 4587             #  -- output --
 4588             '.tabs {\n' +
 4589             '\n' +
 4590             '\n' +
 4591             '    width: 10px; // comment follows rule\n' +
 4592             '\n' +
 4593             '\n' +
 4594             '    // another comment new line\n' +
 4595             '\n' +
 4596             '\n' +
 4597             '}')
 4598         
 4599         # #1165
 4600         t(
 4601             '.tabs{\n' +
 4602             '        \n' +
 4603             '    \n' +
 4604             'width: 10px;\n' +
 4605             '            \n' +
 4606             '   \n' +
 4607             '        // comment follows rule\n' +
 4608             '            \n' +
 4609             '   \n' +
 4610             '// another comment new line\n' +
 4611             '            \n' +
 4612             '   \n' +
 4613             '}',
 4614             #  -- output --
 4615             '.tabs {\n' +
 4616             '\n' +
 4617             '\n' +
 4618             '    width: 10px;\n' +
 4619             '\n' +
 4620             '\n' +
 4621             '    // comment follows rule\n' +
 4622             '\n' +
 4623             '\n' +
 4624             '    // another comment new line\n' +
 4625             '\n' +
 4626             '\n' +
 4627             '}')
 4628         
 4629         # #736
 4630         t(
 4631             '/*\n' +
 4632             ' * comment\n' +
 4633             ' */\n' +
 4634             '        \n' +
 4635             '    \n' +
 4636             '/* another comment */\n' +
 4637             '        \n' +
 4638             '    \n' +
 4639             'body{}\n' +
 4640             '        \n' +
 4641             '    \n',
 4642             #  -- output --
 4643             '/*\n' +
 4644             ' * comment\n' +
 4645             ' */\n' +
 4646             '\n' +
 4647             '\n' +
 4648             '/* another comment */\n' +
 4649             '\n' +
 4650             '\n' +
 4651             'body {}')
 4652         
 4653         # #1348
 4654         t(
 4655             '.demoa1 {\n' +
 4656             '        \n' +
 4657             '    \n' +
 4658             'text-align:left; //demoa1 instructions for LESS note visibility only\n' +
 4659             '            \n' +
 4660             '   \n' +
 4661             '}\n' +
 4662             '        \n' +
 4663             '    \n' +
 4664             '.demob {\n' +
 4665             '        \n' +
 4666             '    \n' +
 4667             'text-align: right;\n' +
 4668             '        \n' +
 4669             '    \n' +
 4670             '}',
 4671             #  -- output --
 4672             '.demoa1 {\n' +
 4673             '\n' +
 4674             '\n' +
 4675             '    text-align: left; //demoa1 instructions for LESS note visibility only\n' +
 4676             '\n' +
 4677             '\n' +
 4678             '}\n' +
 4679             '\n' +
 4680             '\n' +
 4681             '.demob {\n' +
 4682             '\n' +
 4683             '\n' +
 4684             '    text-align: right;\n' +
 4685             '\n' +
 4686             '\n' +
 4687             '}')
 4688         
 4689         # #1440
 4690         t(
 4691             '#search-text {\n' +
 4692             '  width: 43%;\n' +
 4693             '  // height: 100%;\n' +
 4694             '  border: none;\n' +
 4695             '}',
 4696             #  -- output --
 4697             '#search-text {\n' +
 4698             '    width: 43%;\n' +
 4699             '    // height: 100%;\n' +
 4700             '    border: none;\n' +
 4701             '}')
 4702         t(
 4703             '.demoa2 {\n' +
 4704             '        \n' +
 4705             '    \n' +
 4706             'text-align:left;\n' +
 4707             '        \n' +
 4708             '    \n' +
 4709             '}\n' +
 4710             '        \n' +
 4711             '    \n' +
 4712             '//demob instructions for LESS note visibility only\n' +
 4713             '            \n' +
 4714             '   \n' +
 4715             '.demob {\n' +
 4716             '        \n' +
 4717             '    \n' +
 4718             'text-align: right}',
 4719             #  -- output --
 4720             '.demoa2 {\n' +
 4721             '\n' +
 4722             '\n' +
 4723             '    text-align: left;\n' +
 4724             '\n' +
 4725             '\n' +
 4726             '}\n' +
 4727             '\n' +
 4728             '\n' +
 4729             '//demob instructions for LESS note visibility only\n' +
 4730             '\n' +
 4731             '\n' +
 4732             '.demob {\n' +
 4733             '\n' +
 4734             '\n' +
 4735             '    text-align: right\n' +
 4736             '}')
 4737         
 4738         # new lines between rules - #531 and #857
 4739         t(
 4740             '.div{}\n' +
 4741             '            \n' +
 4742             '   \n' +
 4743             '.span {\n' +
 4744             '        \n' +
 4745             '    \n' +
 4746             '}',
 4747             #  -- output --
 4748             '.div {}\n' +
 4749             '\n' +
 4750             '\n' +
 4751             '.span {}')
 4752         t(
 4753             '/**/\n' +
 4754             '        \n' +
 4755             '    \n' +
 4756             '/**/\n' +
 4757             '        \n' +
 4758             '    \n' +
 4759             '//\n' +
 4760             '            \n' +
 4761             '   \n' +
 4762             '/**/\n' +
 4763             '        \n' +
 4764             '    \n' +
 4765             '.div{}\n' +
 4766             '        \n' +
 4767             '    \n' +
 4768             '/**/\n' +
 4769             '        \n' +
 4770             '    \n' +
 4771             '/**/\n' +
 4772             '        \n' +
 4773             '    \n' +
 4774             '//\n' +
 4775             '            \n' +
 4776             '   \n' +
 4777             '/**/\n' +
 4778             '        \n' +
 4779             '    \n' +
 4780             '.span {\n' +
 4781             '        \n' +
 4782             '    \n' +
 4783             '}',
 4784             #  -- output --
 4785             '/**/\n' +
 4786             '\n' +
 4787             '\n' +
 4788             '/**/\n' +
 4789             '\n' +
 4790             '\n' +
 4791             '//\n' +
 4792             '\n' +
 4793             '\n' +
 4794             '/**/\n' +
 4795             '\n' +
 4796             '\n' +
 4797             '.div {}\n' +
 4798             '\n' +
 4799             '\n' +
 4800             '/**/\n' +
 4801             '\n' +
 4802             '\n' +
 4803             '/**/\n' +
 4804             '\n' +
 4805             '\n' +
 4806             '//\n' +
 4807             '\n' +
 4808             '\n' +
 4809             '/**/\n' +
 4810             '\n' +
 4811             '\n' +
 4812             '.span {}')
 4813         t(
 4814             '//\n' +
 4815             '            \n' +
 4816             '   \n' +
 4817             '.div{}\n' +
 4818             '        \n' +
 4819             '    \n' +
 4820             '//\n' +
 4821             '            \n' +
 4822             '   \n' +
 4823             '.span {\n' +
 4824             '        \n' +
 4825             '    \n' +
 4826             '}',
 4827             #  -- output --
 4828             '//\n' +
 4829             '\n' +
 4830             '\n' +
 4831             '.div {}\n' +
 4832             '\n' +
 4833             '\n' +
 4834             '//\n' +
 4835             '\n' +
 4836             '\n' +
 4837             '.span {}')
 4838         t(
 4839             '.selector1 {\n' +
 4840             '        \n' +
 4841             '    \n' +
 4842             'margin: 0; \n' +
 4843             '        \n' +
 4844             '    \n' +
 4845             '/* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 4846             '        \n' +
 4847             '    \n' +
 4848             '}\n' +
 4849             '            \n' +
 4850             '   \n' +
 4851             '.div{\n' +
 4852             '        \n' +
 4853             '    \n' +
 4854             'height:15px;\n' +
 4855             '        \n' +
 4856             '    \n' +
 4857             '}',
 4858             #  -- output --
 4859             '.selector1 {\n' +
 4860             '\n' +
 4861             '\n' +
 4862             '    margin: 0;\n' +
 4863             '\n' +
 4864             '\n' +
 4865             '    /* This is a comment including an url http://domain.com/path/to/file.ext */\n' +
 4866             '\n' +
 4867             '\n' +
 4868             '}\n' +
 4869             '\n' +
 4870             '\n' +
 4871             '.div {\n' +
 4872             '\n' +
 4873             '\n' +
 4874             '    height: 15px;\n' +
 4875             '\n' +
 4876             '\n' +
 4877             '}')
 4878         t(
 4879             '.tabs{\n' +
 4880             '        \n' +
 4881             '    \n' +
 4882             'width:10px;//end of line comment\n' +
 4883             '            \n' +
 4884             '   \n' +
 4885             'height:10px;//another\n' +
 4886             '            \n' +
 4887             '   \n' +
 4888             '}\n' +
 4889             '        \n' +
 4890             '    \n' +
 4891             '.div{\n' +
 4892             '        \n' +
 4893             '    \n' +
 4894             'height:15px;\n' +
 4895             '        \n' +
 4896             '    \n' +
 4897             '}',
 4898             #  -- output --
 4899             '.tabs {\n' +
 4900             '\n' +
 4901             '\n' +
 4902             '    width: 10px; //end of line comment\n' +
 4903             '\n' +
 4904             '\n' +
 4905             '    height: 10px; //another\n' +
 4906             '\n' +
 4907             '\n' +
 4908             '}\n' +
 4909             '\n' +
 4910             '\n' +
 4911             '.div {\n' +
 4912             '\n' +
 4913             '\n' +
 4914             '    height: 15px;\n' +
 4915             '\n' +
 4916             '\n' +
 4917             '}')
 4918         t(
 4919             '#foo {\n' +
 4920             '        \n' +
 4921             '    \n' +
 4922             'background-image: url(foo@2x.png);\n' +
 4923             '        \n' +
 4924             '    \n' +
 4925             '    @font-face {\n' +
 4926             '        \n' +
 4927             '    \n' +
 4928             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4929             '        \n' +
 4930             '    \n' +
 4931             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4932             '        \n' +
 4933             '    \n' +
 4934             '    }\n' +
 4935             '        \n' +
 4936             '    \n' +
 4937             '}\n' +
 4938             '        \n' +
 4939             '    \n' +
 4940             '.div{\n' +
 4941             '        \n' +
 4942             '    \n' +
 4943             'height:15px;\n' +
 4944             '        \n' +
 4945             '    \n' +
 4946             '}',
 4947             #  -- output --
 4948             '#foo {\n' +
 4949             '\n' +
 4950             '\n' +
 4951             '    background-image: url(foo@2x.png);\n' +
 4952             '\n' +
 4953             '\n' +
 4954             '    @font-face {\n' +
 4955             '\n' +
 4956             '\n' +
 4957             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4958             '\n' +
 4959             '\n' +
 4960             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4961             '\n' +
 4962             '\n' +
 4963             '    }\n' +
 4964             '\n' +
 4965             '\n' +
 4966             '}\n' +
 4967             '\n' +
 4968             '\n' +
 4969             '.div {\n' +
 4970             '\n' +
 4971             '\n' +
 4972             '    height: 15px;\n' +
 4973             '\n' +
 4974             '\n' +
 4975             '}')
 4976         t(
 4977             '@media screen {\n' +
 4978             '        \n' +
 4979             '    \n' +
 4980             '    #foo:hover {\n' +
 4981             '        \n' +
 4982             '    \n' +
 4983             '        background-image: url(foo@2x.png);\n' +
 4984             '        \n' +
 4985             '    \n' +
 4986             '    }\n' +
 4987             '        \n' +
 4988             '    \n' +
 4989             '    @font-face {\n' +
 4990             '        \n' +
 4991             '    \n' +
 4992             '        font-family: "Bitstream Vera Serif Bold";\n' +
 4993             '        \n' +
 4994             '    \n' +
 4995             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 4996             '        \n' +
 4997             '    \n' +
 4998             '    }\n' +
 4999             '        \n' +
 5000             '    \n' +
 5001             '}\n' +
 5002             '        \n' +
 5003             '    \n' +
 5004             '.div{\n' +
 5005             '        \n' +
 5006             '    \n' +
 5007             'height:15px;\n' +
 5008             '        \n' +
 5009             '    \n' +
 5010             '}',
 5011             #  -- output --
 5012             '@media screen {\n' +
 5013             '\n' +
 5014             '\n' +
 5015             '    #foo:hover {\n' +
 5016             '\n' +
 5017             '\n' +
 5018             '        background-image: url(foo@2x.png);\n' +
 5019             '\n' +
 5020             '\n' +
 5021             '    }\n' +
 5022             '\n' +
 5023             '\n' +
 5024             '    @font-face {\n' +
 5025             '\n' +
 5026             '\n' +
 5027             '        font-family: "Bitstream Vera Serif Bold";\n' +
 5028             '\n' +
 5029             '\n' +
 5030             '        src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 5031             '\n' +
 5032             '\n' +
 5033             '    }\n' +
 5034             '\n' +
 5035             '\n' +
 5036             '}\n' +
 5037             '\n' +
 5038             '\n' +
 5039             '.div {\n' +
 5040             '\n' +
 5041             '\n' +
 5042             '    height: 15px;\n' +
 5043             '\n' +
 5044             '\n' +
 5045             '}')
 5046         t(
 5047             '@font-face {\n' +
 5048             '        \n' +
 5049             '    \n' +
 5050             '    font-family: "Bitstream Vera Serif Bold";\n' +
 5051             '        \n' +
 5052             '    \n' +
 5053             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 5054             '        \n' +
 5055             '    \n' +
 5056             '}\n' +
 5057             '            \n' +
 5058             '   \n' +
 5059             '@media screen {\n' +
 5060             '        \n' +
 5061             '    \n' +
 5062             '    #foo:hover {\n' +
 5063             '        \n' +
 5064             '    \n' +
 5065             '        background-image: url(foo.png);\n' +
 5066             '        \n' +
 5067             '    \n' +
 5068             '    }\n' +
 5069             '        \n' +
 5070             '    \n' +
 5071             '    @media screen and (min-device-pixel-ratio: 2) {\n' +
 5072             '        \n' +
 5073             '    \n' +
 5074             '        @font-face {\n' +
 5075             '        \n' +
 5076             '    \n' +
 5077             '            font-family: "Helvetica Neue";\n' +
 5078             '        \n' +
 5079             '    \n' +
 5080             '        }\n' +
 5081             '        \n' +
 5082             '    \n' +
 5083             '        #foo:hover {\n' +
 5084             '        \n' +
 5085             '    \n' +
 5086             '            background-image: url(foo@2x.png);\n' +
 5087             '        \n' +
 5088             '    \n' +
 5089             '        }\n' +
 5090             '        \n' +
 5091             '    \n' +
 5092             '    }\n' +
 5093             '        \n' +
 5094             '    \n' +
 5095             '}',
 5096             #  -- output --
 5097             '@font-face {\n' +
 5098             '\n' +
 5099             '\n' +
 5100             '    font-family: "Bitstream Vera Serif Bold";\n' +
 5101             '\n' +
 5102             '\n' +
 5103             '    src: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' +
 5104             '\n' +
 5105             '\n' +
 5106             '}\n' +
 5107             '\n' +
 5108