diff --git a/js/test/generated/beautify-css-tests.js b/js/test/generated/beautify-css-tests.js index 7b6d95611..7d3139f65 100644 --- a/js/test/generated/beautify-css-tests.js +++ b/js/test/generated/beautify-css-tests.js @@ -123,7 +123,15 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea opts.end_with_newline = true; test_fragment('', '\n'); test_fragment(' .tabs{}', ' .tabs {}\n'); - test_fragment(' \n\n.tabs{}\n\n\n\n', ' .tabs {}\n'); + test_fragment( + ' \n' + + '\n' + + '.tabs{}\n' + + '\n' + + '\n' + + '\n', + // -- output -- + ' .tabs {}\n'); test_fragment('\n'); // End With Newline - (eof = "") @@ -131,7 +139,15 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea opts.end_with_newline = false; test_fragment(''); test_fragment(' .tabs{}', ' .tabs {}'); - test_fragment(' \n\n.tabs{}\n\n\n\n', ' .tabs {}'); + test_fragment( + ' \n' + + '\n' + + '.tabs{}\n' + + '\n' + + '\n' + + '\n', + // -- output -- + ' .tabs {}'); test_fragment('\n', ''); @@ -141,13 +157,30 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea t('.tabs{}', '.tabs {}'); t('.tabs { }', '.tabs {}'); t('.tabs { }', '.tabs {}'); - t('.tabs \n{\n \n }', '.tabs {}'); + t( + '.tabs \n' + + '{\n' + + ' \n' + + ' }', + // -- output -- + '.tabs {}'); //============================================================ // reset_options(); - t('#cboxOverlay {\n\tbackground: url(images/overlay.png) repeat 0 0;\n\topacity: 0.9;\n\tfilter: alpha(opacity = 90);\n}', '#cboxOverlay {\n\tbackground: url(images/overlay.png) repeat 0 0;\n\topacity: 0.9;\n\tfilter: alpha(opacity=90);\n}'); + t( + '#cboxOverlay {\n' + + '\tbackground: url(images/overlay.png) repeat 0 0;\n' + + '\topacity: 0.9;\n' + + '\tfilter: alpha(opacity = 90);\n' + + '}', + // -- output -- + '#cboxOverlay {\n' + + '\tbackground: url(images/overlay.png) repeat 0 0;\n' + + '\topacity: 0.9;\n' + + '\tfilter: alpha(opacity=90);\n' + + '}'); //============================================================ @@ -199,21 +232,25 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea t('a + b > c{}', 'a + b > c {}'); t( 'a > b{width: calc(100% + 45px);}', + // -- output -- 'a > b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a ~ b{width: calc(100% + 45px);}', + // -- output -- 'a ~ b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a + b{width: calc(100% + 45px);}', + // -- output -- 'a + b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a + b > c{width: calc(100% + 45px);}', + // -- output -- 'a + b > c {\n' + '\twidth: calc(100% + 45px);\n' + '}'); @@ -231,21 +268,25 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea t('a + b > c{}', 'a+b>c {}'); t( 'a > b{width: calc(100% + 45px);}', + // -- output -- 'a>b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a ~ b{width: calc(100% + 45px);}', + // -- output -- 'a~b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a + b{width: calc(100% + 45px);}', + // -- output -- 'a+b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a + b > c{width: calc(100% + 45px);}', + // -- output -- 'a+b>c {\n' + '\twidth: calc(100% + 45px);\n' + '}'); @@ -263,21 +304,25 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea t('a + b > c{}', 'a + b > c {}'); t( 'a > b{width: calc(100% + 45px);}', + // -- output -- 'a > b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a ~ b{width: calc(100% + 45px);}', + // -- output -- 'a ~ b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a + b{width: calc(100% + 45px);}', + // -- output -- 'a + b {\n' + '\twidth: calc(100% + 45px);\n' + '}'); t( 'a + b > c{width: calc(100% + 45px);}', + // -- output -- 'a + b > c {\n' + '\twidth: calc(100% + 45px);\n' + '}'); @@ -288,41 +333,153 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea reset_options(); opts.selector_separator_newline = false; opts.selector_separator = " "; - t('#bla, #foo{color:green}', '#bla, #foo {\n\tcolor: green\n}'); - t('@media print {.tab{}}', '@media print {\n\t.tab {}\n}'); - t('@media print {.tab,.bat{}}', '@media print {\n\t.tab, .bat {}\n}'); - t('#bla, #foo{color:black}', '#bla, #foo {\n\tcolor: black\n}'); - t('a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', 'a:first-child, a:first-child {\n\tcolor: red;\n\tdiv:first-child, div:hover {\n\t\tcolor: black;\n\t}\n}'); + t( + '#bla, #foo{color:green}', + // -- output -- + '#bla, #foo {\n' + + '\tcolor: green\n' + + '}'); + t( + '@media print {.tab{}}', + // -- output -- + '@media print {\n' + + '\t.tab {}\n' + + '}'); + t( + '@media print {.tab,.bat{}}', + // -- output -- + '@media print {\n' + + '\t.tab, .bat {}\n' + + '}'); + t( + '#bla, #foo{color:black}', + // -- output -- + '#bla, #foo {\n' + + '\tcolor: black\n' + + '}'); + t( + 'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', + // -- output -- + 'a:first-child, a:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:first-child, div:hover {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}'); // Selector Separator - (separator = " ", separator1 = " ") reset_options(); opts.selector_separator_newline = false; opts.selector_separator = " "; - t('#bla, #foo{color:green}', '#bla, #foo {\n\tcolor: green\n}'); - t('@media print {.tab{}}', '@media print {\n\t.tab {}\n}'); - t('@media print {.tab,.bat{}}', '@media print {\n\t.tab, .bat {}\n}'); - t('#bla, #foo{color:black}', '#bla, #foo {\n\tcolor: black\n}'); - t('a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', 'a:first-child, a:first-child {\n\tcolor: red;\n\tdiv:first-child, div:hover {\n\t\tcolor: black;\n\t}\n}'); + t( + '#bla, #foo{color:green}', + // -- output -- + '#bla, #foo {\n' + + '\tcolor: green\n' + + '}'); + t( + '@media print {.tab{}}', + // -- output -- + '@media print {\n' + + '\t.tab {}\n' + + '}'); + t( + '@media print {.tab,.bat{}}', + // -- output -- + '@media print {\n' + + '\t.tab, .bat {}\n' + + '}'); + t( + '#bla, #foo{color:black}', + // -- output -- + '#bla, #foo {\n' + + '\tcolor: black\n' + + '}'); + t( + 'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', + // -- output -- + 'a:first-child, a:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:first-child, div:hover {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}'); // Selector Separator - (separator = "\n", separator1 = "\n\t") reset_options(); opts.selector_separator_newline = true; opts.selector_separator = " "; - t('#bla, #foo{color:green}', '#bla,\n#foo {\n\tcolor: green\n}'); - t('@media print {.tab{}}', '@media print {\n\t.tab {}\n}'); - t('@media print {.tab,.bat{}}', '@media print {\n\t.tab,\n\t.bat {}\n}'); - t('#bla, #foo{color:black}', '#bla,\n#foo {\n\tcolor: black\n}'); - t('a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', 'a:first-child,\na:first-child {\n\tcolor: red;\n\tdiv:first-child,\n\tdiv:hover {\n\t\tcolor: black;\n\t}\n}'); + t( + '#bla, #foo{color:green}', + // -- output -- + '#bla,\n#foo {\n' + + '\tcolor: green\n' + + '}'); + t( + '@media print {.tab{}}', + // -- output -- + '@media print {\n' + + '\t.tab {}\n' + + '}'); + t( + '@media print {.tab,.bat{}}', + // -- output -- + '@media print {\n' + + '\t.tab,\n\t.bat {}\n' + + '}'); + t( + '#bla, #foo{color:black}', + // -- output -- + '#bla,\n#foo {\n' + + '\tcolor: black\n' + + '}'); + t( + 'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', + // -- output -- + 'a:first-child,\na:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:first-child,\n\tdiv:hover {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}'); // Selector Separator - (separator = "\n", separator1 = "\n\t") reset_options(); opts.selector_separator_newline = true; opts.selector_separator = " "; - t('#bla, #foo{color:green}', '#bla,\n#foo {\n\tcolor: green\n}'); - t('@media print {.tab{}}', '@media print {\n\t.tab {}\n}'); - t('@media print {.tab,.bat{}}', '@media print {\n\t.tab,\n\t.bat {}\n}'); - t('#bla, #foo{color:black}', '#bla,\n#foo {\n\tcolor: black\n}'); - t('a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', 'a:first-child,\na:first-child {\n\tcolor: red;\n\tdiv:first-child,\n\tdiv:hover {\n\t\tcolor: black;\n\t}\n}'); + t( + '#bla, #foo{color:green}', + // -- output -- + '#bla,\n#foo {\n' + + '\tcolor: green\n' + + '}'); + t( + '@media print {.tab{}}', + // -- output -- + '@media print {\n' + + '\t.tab {}\n' + + '}'); + t( + '@media print {.tab,.bat{}}', + // -- output -- + '@media print {\n' + + '\t.tab,\n\t.bat {}\n' + + '}'); + t( + '#bla, #foo{color:black}', + // -- output -- + '#bla,\n#foo {\n' + + '\tcolor: black\n' + + '}'); + t( + 'a:first-child,a:first-child{color:red;div:first-child,div:hover{color:black;}}', + // -- output -- + 'a:first-child,\na:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:first-child,\n\tdiv:hover {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}'); //============================================================ @@ -330,52 +487,378 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea reset_options(); opts.preserve_newlines = true; t('.div {}\n\n.span {}'); - t('#bla, #foo{\n\tcolor:black;\n\n\tfont-size: 12px;\n}', '#bla,\n#foo {\n\tcolor: black;\n\n\tfont-size: 12px;\n}'); + t( + '#bla, #foo{\n' + + '\tcolor:black;\n\n\tfont-size: 12px;\n' + + '}', + // -- output -- + '#bla,\n' + + '#foo {\n' + + '\tcolor: black;\n\n\tfont-size: 12px;\n' + + '}'); // Preserve Newlines - (separator_input = "\n\n", separator_output = "\n") reset_options(); opts.preserve_newlines = false; t('.div {}\n\n.span {}', '.div {}\n.span {}'); - t('#bla, #foo{\n\tcolor:black;\n\n\tfont-size: 12px;\n}', '#bla,\n#foo {\n\tcolor: black;\n\tfont-size: 12px;\n}'); + t( + '#bla, #foo{\n' + + '\tcolor:black;\n\n\tfont-size: 12px;\n' + + '}', + // -- output -- + '#bla,\n' + + '#foo {\n' + + '\tcolor: black;\n\tfont-size: 12px;\n' + + '}'); //============================================================ // Preserve Newlines and add tabs reset_options(); opts.preserve_newlines = true; - t('.tool-tip {\n\tposition: relative;\n\n\t\t\n\t.tool-tip-content {\n\t\t&>* {\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t\n\n\t\t.mixin-box-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .15));\n\t\tpadding: 1rem;\n\t\tposition: absolute;\n\t\tz-index: 10;\n\t}\n}', '.tool-tip {\n\tposition: relative;\n\n\n\t.tool-tip-content {\n\t\t&>* {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\n\t\t.mixin-box-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .15));\n\t\tpadding: 1rem;\n\t\tposition: absolute;\n\t\tz-index: 10;\n\t}\n}'); + t( + '.tool-tip {\n' + + '\tposition: relative;\n' + + '\n' + + '\t\t\n' + + '\t.tool-tip-content {\n' + + '\t\t&>* {\n' + + '\t\t\tmargin-top: 0;\n' + + '\t\t}\n' + + '\t\t\n' + + '\n' + + '\t\t.mixin-box-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .15));\n' + + '\t\tpadding: 1rem;\n' + + '\t\tposition: absolute;\n' + + '\t\tz-index: 10;\n' + + '\t}\n' + + '}', + // -- output -- + '.tool-tip {\n' + + '\tposition: relative;\n' + + '\n' + + '\n' + + '\t.tool-tip-content {\n' + + '\t\t&>* {\n' + + '\t\t\tmargin-top: 0;\n' + + '\t\t}\n' + + '\n\n\t\t.mixin-box-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .15));\n' + + '\t\tpadding: 1rem;\n' + + '\t\tposition: absolute;\n' + + '\t\tz-index: 10;\n' + + '\t}\n' + + '}'); //============================================================ // Newline Between Rules - (separator = "\n") reset_options(); opts.newline_between_rules = true; - t('.div {}\n.span {}', '.div {}\n\n.span {}'); - t('.div{}\n \n.span{}', '.div {}\n\n.span {}'); - t('.div {} \n \n.span { } \n', '.div {}\n\n.span {}'); - t('.div {\n \n} \n .span {\n } ', '.div {}\n\n.span {}'); - t('.selector1 {\n\tmargin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n}\n.div{height:15px;}', '.selector1 {\n\tmargin: 0;\n\t/* This is a comment including an url http://domain.com/path/to/file.ext */\n}\n\n.div {\n\theight: 15px;\n}'); - t('.tabs{width:10px;//end of line comment\nheight:10px;//another\n}\n.div{height:15px;}', '.tabs {\n\twidth: 10px; //end of line comment\n\theight: 10px; //another\n}\n\n.div {\n\theight: 15px;\n}'); - t('#foo {\n\tbackground-image: url(foo@2x.png);\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n.div{height:15px;}', '#foo {\n\tbackground-image: url(foo@2x.png);\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n\n.div {\n\theight: 15px;\n}'); - t('@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo@2x.png);\n\t}\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n.div{height:15px;}', '@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo@2x.png);\n\t}\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n\n.div {\n\theight: 15px;\n}'); - t('@font-face {\n\tfont-family: "Bitstream Vera Serif Bold";\n\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n}\n@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo.png);\n\t}\n\t@media screen and (min-device-pixel-ratio: 2) {\n\t\t@font-face {\n\t\t\tfont-family: "Helvetica Neue"\n\t\t}\n\t\t#foo:hover {\n\t\t\tbackground-image: url(foo@2x.png);\n\t\t}\n\t}\n}', '@font-face {\n\tfont-family: "Bitstream Vera Serif Bold";\n\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n}\n\n@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo.png);\n\t}\n\t@media screen and (min-device-pixel-ratio: 2) {\n\t\t@font-face {\n\t\t\tfont-family: "Helvetica Neue"\n\t\t}\n\t\t#foo:hover {\n\t\t\tbackground-image: url(foo@2x.png);\n\t\t}\n\t}\n}'); - t('a:first-child{color:red;div:first-child{color:black;}}\n.div{height:15px;}', 'a:first-child {\n\tcolor: red;\n\tdiv:first-child {\n\t\tcolor: black;\n\t}\n}\n\n.div {\n\theight: 15px;\n}'); - t('a:first-child{color:red;div:not(.peq){color:black;}}\n.div{height:15px;}', 'a:first-child {\n\tcolor: red;\n\tdiv:not(.peq) {\n\t\tcolor: black;\n\t}\n}\n\n.div {\n\theight: 15px;\n}'); + t( + '.div {}\n' + + '.span {}', + // -- output -- + '.div {}\n' + + '\n.span {}'); + t( + '.div{}\n' + + ' \n' + + '.span{}', + // -- output -- + '.div {}\n' + + '\n.span {}'); + t( + '.div {} \n' + + ' \n' + + '.span { } \n', + // -- output -- + '.div {}\n' + + '\n.span {}'); + t( + '.div {\n' + + ' \n' + + '} \n' + + ' .span {\n' + + ' } ', + // -- output -- + '.div {}\n' + + '\n.span {}'); + t( + '.selector1 {\n' + + '\tmargin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '.selector1 {\n' + + '\tmargin: 0;\n' + + '\t/* This is a comment including an url http://domain.com/path/to/file.ext */\n' + + '}\n' + + '\n.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '.tabs{width:10px;//end of line comment\n' + + 'height:10px;//another\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '.tabs {\n' + + '\twidth: 10px; //end of line comment\n' + + '\theight: 10px; //another\n' + + '}\n' + + '\n.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '#foo {\n' + + '\tbackground-image: url(foo@2x.png);\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '#foo {\n' + + '\tbackground-image: url(foo@2x.png);\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '\n.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo@2x.png);\n' + + '\t}\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo@2x.png);\n' + + '\t}\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '\n.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '@font-face {\n' + + '\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '}\n' + + '@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo.png);\n' + + '\t}\n' + + '\t@media screen and (min-device-pixel-ratio: 2) {\n' + + '\t\t@font-face {\n' + + '\t\t\tfont-family: "Helvetica Neue"\n' + + '\t\t}\n' + + '\t\t#foo:hover {\n' + + '\t\t\tbackground-image: url(foo@2x.png);\n' + + '\t\t}\n' + + '\t}\n' + + '}', + // -- output -- + '@font-face {\n' + + '\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '}\n' + + '\n@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo.png);\n' + + '\t}\n' + + '\t@media screen and (min-device-pixel-ratio: 2) {\n' + + '\t\t@font-face {\n' + + '\t\t\tfont-family: "Helvetica Neue"\n' + + '\t\t}\n' + + '\t\t#foo:hover {\n' + + '\t\t\tbackground-image: url(foo@2x.png);\n' + + '\t\t}\n' + + '\t}\n' + + '}'); + t( + 'a:first-child{color:red;div:first-child{color:black;}}\n' + + '.div{height:15px;}', + // -- output -- + 'a:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:first-child {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}\n' + + '\n.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + 'a:first-child{color:red;div:not(.peq){color:black;}}\n' + + '.div{height:15px;}', + // -- output -- + 'a:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:not(.peq) {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}\n' + + '\n.div {\n' + + '\theight: 15px;\n' + + '}'); // Newline Between Rules - (separator = "") reset_options(); opts.newline_between_rules = false; - t('.div {}\n.span {}'); - t('.div{}\n \n.span{}', '.div {}\n.span {}'); - t('.div {} \n \n.span { } \n', '.div {}\n.span {}'); - t('.div {\n \n} \n .span {\n } ', '.div {}\n.span {}'); - t('.selector1 {\n\tmargin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n}\n.div{height:15px;}', '.selector1 {\n\tmargin: 0;\n\t/* This is a comment including an url http://domain.com/path/to/file.ext */\n}\n.div {\n\theight: 15px;\n}'); - t('.tabs{width:10px;//end of line comment\nheight:10px;//another\n}\n.div{height:15px;}', '.tabs {\n\twidth: 10px; //end of line comment\n\theight: 10px; //another\n}\n.div {\n\theight: 15px;\n}'); - t('#foo {\n\tbackground-image: url(foo@2x.png);\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n.div{height:15px;}', '#foo {\n\tbackground-image: url(foo@2x.png);\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n.div {\n\theight: 15px;\n}'); - t('@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo@2x.png);\n\t}\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n.div{height:15px;}', '@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo@2x.png);\n\t}\n\t@font-face {\n\t\tfont-family: "Bitstream Vera Serif Bold";\n\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n\t}\n}\n.div {\n\theight: 15px;\n}'); - t('@font-face {\n\tfont-family: "Bitstream Vera Serif Bold";\n\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n}\n@media screen {\n\t#foo:hover {\n\t\tbackground-image: url(foo.png);\n\t}\n\t@media screen and (min-device-pixel-ratio: 2) {\n\t\t@font-face {\n\t\t\tfont-family: "Helvetica Neue"\n\t\t}\n\t\t#foo:hover {\n\t\t\tbackground-image: url(foo@2x.png);\n\t\t}\n\t}\n}'); - t('a:first-child{color:red;div:first-child{color:black;}}\n.div{height:15px;}', 'a:first-child {\n\tcolor: red;\n\tdiv:first-child {\n\t\tcolor: black;\n\t}\n}\n.div {\n\theight: 15px;\n}'); - t('a:first-child{color:red;div:not(.peq){color:black;}}\n.div{height:15px;}', 'a:first-child {\n\tcolor: red;\n\tdiv:not(.peq) {\n\t\tcolor: black;\n\t}\n}\n.div {\n\theight: 15px;\n}'); + t( + '.div {}\n' + + '.span {}'); + t( + '.div{}\n' + + ' \n' + + '.span{}', + // -- output -- + '.div {}\n' + + '.span {}'); + t( + '.div {} \n' + + ' \n' + + '.span { } \n', + // -- output -- + '.div {}\n' + + '.span {}'); + t( + '.div {\n' + + ' \n' + + '} \n' + + ' .span {\n' + + ' } ', + // -- output -- + '.div {}\n' + + '.span {}'); + t( + '.selector1 {\n' + + '\tmargin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '.selector1 {\n' + + '\tmargin: 0;\n' + + '\t/* This is a comment including an url http://domain.com/path/to/file.ext */\n' + + '}\n' + + '.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '.tabs{width:10px;//end of line comment\n' + + 'height:10px;//another\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '.tabs {\n' + + '\twidth: 10px; //end of line comment\n' + + '\theight: 10px; //another\n' + + '}\n' + + '.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '#foo {\n' + + '\tbackground-image: url(foo@2x.png);\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '#foo {\n' + + '\tbackground-image: url(foo@2x.png);\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo@2x.png);\n' + + '\t}\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '.div{height:15px;}', + // -- output -- + '@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo@2x.png);\n' + + '\t}\n' + + '\t@font-face {\n' + + '\t\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\t\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '\t}\n' + + '}\n' + + '.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + '@font-face {\n' + + '\tfont-family: "Bitstream Vera Serif Bold";\n' + + '\tsrc: url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf");\n' + + '}\n' + + '@media screen {\n' + + '\t#foo:hover {\n' + + '\t\tbackground-image: url(foo.png);\n' + + '\t}\n' + + '\t@media screen and (min-device-pixel-ratio: 2) {\n' + + '\t\t@font-face {\n' + + '\t\t\tfont-family: "Helvetica Neue"\n' + + '\t\t}\n' + + '\t\t#foo:hover {\n' + + '\t\t\tbackground-image: url(foo@2x.png);\n' + + '\t\t}\n' + + '\t}\n' + + '}'); + t( + 'a:first-child{color:red;div:first-child{color:black;}}\n' + + '.div{height:15px;}', + // -- output -- + 'a:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:first-child {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}\n' + + '.div {\n' + + '\theight: 15px;\n' + + '}'); + t( + 'a:first-child{color:red;div:not(.peq){color:black;}}\n' + + '.div{height:15px;}', + // -- output -- + 'a:first-child {\n' + + '\tcolor: red;\n' + + '\tdiv:not(.peq) {\n' + + '\t\tcolor: black;\n' + + '\t}\n' + + '}\n' + + '.div {\n' + + '\theight: 15px;\n' + + '}'); //============================================================ @@ -383,54 +866,200 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea reset_options(); t('.tabs(){}', '.tabs() {}'); t('.tabs (){}', '.tabs () {}'); - t('.tabs (pa, pa(1,2)), .cols { }', '.tabs (pa, pa(1, 2)),\n.cols {}'); - t('.tabs(pa, pa(1,2)), .cols { }', '.tabs(pa, pa(1, 2)),\n.cols {}'); + t( + '.tabs (pa, pa(1,2)), .cols { }', + // -- output -- + '.tabs (pa, pa(1, 2)),\n' + + '.cols {}'); + t( + '.tabs(pa, pa(1,2)), .cols { }', + // -- output -- + '.tabs(pa, pa(1, 2)),\n' + + '.cols {}'); t('.tabs ( ) { }', '.tabs () {}'); t('.tabs( ) { }', '.tabs() {}'); - t('.tabs (t, t2) \n{\n key: val(p1 ,p2); \n }', '.tabs (t, t2) {\n\tkey: val(p1, p2);\n}'); - t('.box-shadow(@shadow: 0 1px 3px rgba(0, 0, 0, .25)) {\n\t-webkit-box-shadow: @shadow;\n\t-moz-box-shadow: @shadow;\n\tbox-shadow: @shadow;\n}'); + t( + '.tabs (t, t2) \n' + + '{\n' + + ' key: val(p1 ,p2); \n' + + ' }', + // -- output -- + '.tabs (t, t2) {\n' + + '\tkey: val(p1, p2);\n' + + '}'); + t( + '.box-shadow(@shadow: 0 1px 3px rgba(0, 0, 0, .25)) {\n' + + '\t-webkit-box-shadow: @shadow;\n' + + '\t-moz-box-shadow: @shadow;\n' + + '\tbox-shadow: @shadow;\n' + + '}'); //============================================================ // Comments reset_options(); t('/* test */'); - t('.tabs{/* test */}', '.tabs {\n\t/* test */\n}'); - t('.tabs{/* test */}', '.tabs {\n\t/* test */\n}'); - t('/* header */.tabs {}', '/* header */\n\n.tabs {}'); - t('.tabs {\n/* non-header */\nwidth:10px;}', '.tabs {\n\t/* non-header */\n\twidth: 10px;\n}'); + t( + '.tabs{/* test */}', + // -- output -- + '.tabs {\n' + + '\t/* test */\n' + + '}'); + t( + '.tabs{/* test */}', + // -- output -- + '.tabs {\n' + + '\t/* test */\n' + + '}'); + t( + '/* header */.tabs {}', + // -- output -- + '/* header */\n' + + '\n' + + '.tabs {}'); + t( + '.tabs {\n' + + '/* non-header */\n' + + 'width:10px;}', + // -- output -- + '.tabs {\n' + + '\t/* non-header */\n' + + '\twidth: 10px;\n' + + '}'); t('/* header'); t('// comment'); - t('.selector1 {\n\tmargin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n}', '.selector1 {\n\tmargin: 0;\n\t/* This is a comment including an url http://domain.com/path/to/file.ext */\n}'); + t( + '.selector1 {\n' + + '\tmargin: 0; /* This is a comment including an url http://domain.com/path/to/file.ext */\n' + + '}', + // -- output -- + '.selector1 {\n' + + '\tmargin: 0;\n' + + '\t/* This is a comment including an url http://domain.com/path/to/file.ext */\n' + + '}'); // single line comment support (less/sass) - t('.tabs{\n// comment\nwidth:10px;\n}', '.tabs {\n\t// comment\n\twidth: 10px;\n}'); - t('.tabs{// comment\nwidth:10px;\n}', '.tabs {\n\t// comment\n\twidth: 10px;\n}'); - t('//comment\n.tabs{width:10px;}', '//comment\n.tabs {\n\twidth: 10px;\n}'); - t('.tabs{//comment\n//2nd single line comment\nwidth:10px;}', '.tabs {\n\t//comment\n\t//2nd single line comment\n\twidth: 10px;\n}'); - t('.tabs{width:10px;//end of line comment\n}', '.tabs {\n\twidth: 10px; //end of line comment\n}'); - t('.tabs{width:10px;//end of line comment\nheight:10px;}', '.tabs {\n\twidth: 10px; //end of line comment\n\theight: 10px;\n}'); - t('.tabs{width:10px;//end of line comment\nheight:10px;//another\n}', '.tabs {\n\twidth: 10px; //end of line comment\n\theight: 10px; //another\n}'); + t( + '.tabs{\n' + + '// comment\n' + + 'width:10px;\n' + + '}', + // -- output -- + '.tabs {\n' + + '\t// comment\n' + + '\twidth: 10px;\n' + + '}'); + t( + '.tabs{// comment\n' + + 'width:10px;\n' + + '}', + // -- output -- + '.tabs {\n' + + '\t// comment\n' + + '\twidth: 10px;\n' + + '}'); + t( + '//comment\n' + + '.tabs{width:10px;}', + // -- output -- + '//comment\n' + + '.tabs {\n' + + '\twidth: 10px;\n' + + '}'); + t( + '.tabs{//comment\n' + + '//2nd single line comment\n' + + 'width:10px;}', + // -- output -- + '.tabs {\n' + + '\t//comment\n' + + '\t//2nd single line comment\n' + + '\twidth: 10px;\n' + + '}'); + t( + '.tabs{width:10px;//end of line comment\n' + + '}', + // -- output -- + '.tabs {\n' + + '\twidth: 10px; //end of line comment\n' + + '}'); + t( + '.tabs{width:10px;//end of line comment\n' + + 'height:10px;}', + // -- output -- + '.tabs {\n' + + '\twidth: 10px; //end of line comment\n' + + '\theight: 10px;\n' + + '}'); + t( + '.tabs{width:10px;//end of line comment\n' + + 'height:10px;//another\n' + + '}', + // -- output -- + '.tabs {\n' + + '\twidth: 10px; //end of line comment\n' + + '\theight: 10px; //another\n' + + '}'); //============================================================ // Handle LESS property name interpolation reset_options(); - t('tag {\n\t@{prop}: none;\n}'); - t('tag{@{prop}:none;}', 'tag {\n\t@{prop}: none;\n}'); - t('tag{ @{prop}: none;}', 'tag {\n\t@{prop}: none;\n}'); + t( + 'tag {\n' + + '\t@{prop}: none;\n' + + '}'); + t( + 'tag{@{prop}:none;}', + // -- output -- + 'tag {\n' + + '\t@{prop}: none;\n' + + '}'); + t( + 'tag{ @{prop}: none;}', + // -- output -- + 'tag {\n' + + '\t@{prop}: none;\n' + + '}'); // can also be part of property name - t('tag {\n\tdynamic-@{prop}: none;\n}'); - t('tag{dynamic-@{prop}:none;}', 'tag {\n\tdynamic-@{prop}: none;\n}'); - t('tag{ dynamic-@{prop}: none;}', 'tag {\n\tdynamic-@{prop}: none;\n}'); + t( + 'tag {\n' + + '\tdynamic-@{prop}: none;\n' + + '}'); + t( + 'tag{dynamic-@{prop}:none;}', + // -- output -- + 'tag {\n' + + '\tdynamic-@{prop}: none;\n' + + '}'); + t( + 'tag{ dynamic-@{prop}: none;}', + // -- output -- + 'tag {\n' + + '\tdynamic-@{prop}: none;\n' + + '}'); //============================================================ // Handle LESS property name interpolation, test #631 reset_options(); - t('.generate-columns(@n, @i: 1) when (@i =< @n) {\n\t.column-@{i} {\n\t\twidth: (@i * 100% / @n);\n\t}\n\t.generate-columns(@n, (@i + 1));\n}'); - t('.generate-columns(@n,@i:1) when (@i =< @n){.column-@{i}{width:(@i * 100% / @n);}.generate-columns(@n,(@i + 1));}', '.generate-columns(@n, @i: 1) when (@i =< @n) {\n\t.column-@{i} {\n\t\twidth: (@i * 100% / @n);\n\t}\n\t.generate-columns(@n, (@i + 1));\n}'); + t( + '.generate-columns(@n, @i: 1) when (@i =< @n) {\n' + + '\t.column-@{i} {\n' + + '\t\twidth: (@i * 100% / @n);\n' + + '\t}\n' + + '\t.generate-columns(@n, (@i + 1));\n' + + '}'); + t( + '.generate-columns(@n,@i:1) when (@i =< @n){.column-@{i}{width:(@i * 100% / @n);}.generate-columns(@n,(@i + 1));}', + // -- output -- + '.generate-columns(@n, @i: 1) when (@i =< @n) {\n' + + '\t.column-@{i} {\n' + + '\t\twidth: (@i * 100% / @n);\n' + + '\t}\n' + + '\t.generate-columns(@n, (@i + 1));\n' + + '}'); //============================================================ @@ -448,7 +1077,12 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea reset_options(); // Basic Interpolation - t('p {\n\t$font-size: 12px;\n\t$line-height: 30px;\n\tfont: #{$font-size}/#{$line-height};\n}'); + t( + 'p {\n' + + '\t$font-size: 12px;\n' + + '\t$line-height: 30px;\n' + + '\tfont: #{$font-size}/#{$line-height};\n' + + '}'); t('p.#{$name} {}'); t( '@mixin itemPropertiesCoverItem($items, $margin) {\n' + @@ -474,7 +1108,14 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea t('a ::b {}'); t('a:b {}'); t('a::b {}'); - t('a {}, a::b {}, a ::b {}, a:b {}, a :b {}', 'a {}\n, a::b {}\n, a ::b {}\n, a:b {}\n, a :b {}'); + t( + 'a {}, a::b {}, a ::b {}, a:b {}, a :b {}', + // -- output -- + 'a {}\n' + + ', a::b {}\n' + + ', a ::b {}\n' + + ', a:b {}\n' + + ', a :b {}'); t( '.card-blue ::-webkit-input-placeholder {\n' + '\tcolor: #87D1FF;\n' + diff --git a/js/test/generated/beautify-html-tests.js b/js/test/generated/beautify-html-tests.js index 6353fbeda..b5a069a58 100644 --- a/js/test/generated/beautify-html-tests.js +++ b/js/test/generated/beautify-html-tests.js @@ -128,6 +128,7 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be reset_options(); test_fragment( '

Block

', + // -- output -- '\n' + '

Block

\n' + ''); @@ -154,28 +155,79 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be // Custom Extra Liners (empty) - () reset_options(); opts.extra_liners = []; - test_fragment('

x

', '\n\n \n\n\n
\n

x

\n
\n\n'); + test_fragment( + '

x

', + // -- output -- + '\n' + + '\n' + + ' \n' + + '\n' + + '\n' + + '
\n' + + '

x

\n' + + '
\n' + + '\n' + + ''); //============================================================ // Custom Extra Liners (default) - () reset_options(); opts.extra_liners = null; - test_fragment('', '\n\n\n\n\n\n'); + test_fragment( + '', + // -- output -- + '\n' + + '\n' + + '\n' + + '\n' + + '\n' + + '\n' + + ''); //============================================================ // Custom Extra Liners (p, string) - () reset_options(); opts.extra_liners = 'p,/p'; - test_fragment('

x

', '\n\n \n\n\n
\n\n

x\n\n

\n
\n\n'); + test_fragment( + '

x

', + // -- output -- + '\n' + + '\n' + + ' \n' + + '\n' + + '\n' + + '
\n' + + '\n' + + '

x\n' + + '\n' + + '

\n' + + '
\n' + + '\n' + + ''); //============================================================ // Custom Extra Liners (p) - () reset_options(); opts.extra_liners = ['p', '/p']; - test_fragment('

x

', '\n\n \n\n\n
\n\n

x\n\n

\n
\n\n'); + test_fragment( + '

x

', + // -- output -- + '\n' + + '\n' + + ' \n' + + '\n' + + '\n' + + '
\n' + + '\n' + + '

x\n' + + '\n' + + '

\n' + + '
\n' + + '\n' + + ''); //============================================================ @@ -183,66 +235,79 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be reset_options(); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- ''); bth( '', + // -- output -- '', + // -- output -- '\n' + '\n' + '

A

\n' + @@ -1131,12 +2050,18 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be ''); test_fragment( '

Beautify me

But not me

', + // -- output -- '
\n' + '

Beautify me

\n' + '
\n' + '

But not me

'); test_fragment( - '
Beautify me

But not me

', + '
Beautify me

But not me

', + // -- output -- '
\n' + '

Beautify me

\n' + '
\n' + @@ -1146,12 +2071,18 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be test_fragment('
blabla
something here
'); test_fragment('

'); test_fragment( - '
var a=1;\nvar b=a;
', + '
var a=1;\n' +
+            'var b=a;
', + // -- output -- '
\n' + '
var a=1; var b=a;
\n' + '
'); test_fragment( - '
\nvar a=1;\nvar b=a;\n
', + '
\n' +
+            'var a=1;\n' +
+            'var b=a;\n' +
+            '
', + // -- output -- '
\n' + '
\n' +
             '        var a=1; var b=a;\n' +
@@ -1164,6 +2095,7 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be
         reset_options();
         test_fragment(
             '

A

', + // -- output -- '\n' + '\n' + '

A

\n' + @@ -1182,6 +2114,7 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be ''); test_fragment( '

Beautify me

But not me

', + // -- output -- '
\n' + '

Beautify me

\n' + '
\n' + @@ -1189,7 +2122,12 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be '

But not me

\n' + '

'); test_fragment( - '
Beautify me

But not me

', + '
Beautify me

But not me

', + // -- output -- '
\n' + '

Beautify me

\n' + '
\n' + @@ -1199,13 +2137,19 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be test_fragment('
blabla
something here
'); test_fragment('

'); test_fragment( - '
var a=1;\nvar b=a;
', + '
var a=1;\n' +
+            'var b=a;
', + // -- output -- '
\n' + '
var a=1;\n' +
             'var b=a;
\n' + '
'); test_fragment( - '
\nvar a=1;\nvar b=a;\n
', + '
\n' +
+            'var a=1;\n' +
+            'var b=a;\n' +
+            '
', + // -- output -- '
\n' + '
\n' +
             'var a=1;\n' +
diff --git a/js/test/generated/beautify-javascript-tests.js b/js/test/generated/beautify-javascript-tests.js
index 1a0b39f87..f36128e5d 100644
--- a/js/test/generated/beautify-javascript-tests.js
+++ b/js/test/generated/beautify-javascript-tests.js
@@ -307,10 +307,22 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         // Test template and continuation strings
         reset_options();
         bt('`This is a ${template} string.`');
-        bt('`This\n  is\n  a\n  ${template}\n  string.`');
-        bt('a = `This is a continuation\\nstring.`');
-        bt('a = "This is a continuation\\nstring."');
-        bt('`SELECT\n  nextval(\'${this.options.schema ? `${this.options.schema}.` : \'\'}"${this.tableName}_${this.autoIncrementField}_seq"\'::regclass\n  ) nextval;`');
+        bt(
+            '`This\n' +
+            '  is\n' +
+            '  a\n' +
+            '  ${template}\n' +
+            '  string.`');
+        bt(
+            'a = `This is a continuation\\\n' +
+            'string.`');
+        bt(
+            'a = "This is a continuation\\\n' +
+            'string."');
+        bt(
+            '`SELECT\n' +
+            '  nextval(\'${this.options.schema ? `${this.options.schema}.` : \'\'}"${this.tableName}_${this.autoIncrementField}_seq"\'::regclass\n' +
+            '  ) nextval;`');
         
         // Tests for #1030
         bt(
@@ -353,7 +365,11 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         reset_options();
         opts.brace_style = "collapse,preserve-inline";
         bt('const m = { ...item, c: 3 };');
-        bt('const m = {\n    ...item,\n    c: 3\n};');
+        bt(
+            'const m = {\n' +
+            '    ...item,\n' +
+            '    c: 3\n' +
+            '};');
         bt('const m = { c: 3, ...item };');
         bt('const m = [...item, 3];');
         bt('const m = [3, ...item];');
@@ -362,7 +378,12 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         //============================================================
         // Object literal shorthand functions
         reset_options();
-        bt('return {\n    foo() {\n        return 42;\n    }\n}');
+        bt(
+            'return {\n' +
+            '    foo() {\n' +
+            '        return 42;\n' +
+            '    }\n' +
+            '}');
         bt(
             'var foo = {\n' +
             '    * bar() {\n' +
@@ -371,6 +392,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '};');
         bt(
             'var foo = {bar(){return 42;},*barGen(){yield 42;}};',
+            //  -- output --
             'var foo = {\n' +
             '    bar() {\n' +
             '        return 42;\n' +
@@ -409,7 +431,15 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         opts.end_with_newline = true;
         test_fragment('', '\n');
         test_fragment('   return .5', '   return .5\n');
-        test_fragment('   \n\nreturn .5\n\n\n\n', '   return .5\n');
+        test_fragment(
+            '   \n' +
+            '\n' +
+            'return .5\n' +
+            '\n' +
+            '\n' +
+            '\n',
+            //  -- output --
+            '   return .5\n');
         test_fragment('\n');
 
         // End With Newline - (eof = "")
@@ -417,7 +447,15 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         opts.end_with_newline = false;
         test_fragment('');
         test_fragment('   return .5');
-        test_fragment('   \n\nreturn .5\n\n\n\n', '   return .5');
+        test_fragment(
+            '   \n' +
+            '\n' +
+            'return .5\n' +
+            '\n' +
+            '\n' +
+            '\n',
+            //  -- output --
+            '   return .5');
         test_fragment('\n', '');
 
 
@@ -455,32 +493,88 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         // Brace style permutations - (ibo = "", iao = "", ibc = "", iac = "", obo = " ", oao = " ", obc = " ", oac = " ")
         reset_options();
         opts.brace_style = 'collapse,preserve-inline';
-        bt('var a ={a: 2};\nvar a ={a: 2};', 'var a = { a: 2 };\nvar a = { a: 2 };');
-        bt('//case 1\nif (a == 1){}\n//case 2\nelse if (a == 2){}', '//case 1\nif (a == 1) {}\n//case 2\nelse if (a == 2) {}');
+        bt(
+            'var a ={a: 2};\n' +
+            'var a ={a: 2};',
+            //  -- output --
+            'var a = { a: 2 };\n' +
+            'var a = { a: 2 };');
+        bt(
+            '//case 1\n' +
+            'if (a == 1){}\n' +
+            '//case 2\n' +
+            'else if (a == 2){}',
+            //  -- output --
+            '//case 1\n' +
+            'if (a == 1) {}\n' +
+            '//case 2\n' +
+            'else if (a == 2) {}');
         bt('if(1){2}else{3}', 'if (1) { 2 } else { 3 }');
         bt('try{a();}catch(b){c();}catch(d){}finally{e();}', 'try { a(); } catch (b) { c(); } catch (d) {} finally { e(); }');
 
         // Brace style permutations - (ibo = "\n", iao = "\n", ibc = "\n", iac = "\n", obo = " ", oao = "\n    ", obc = "\n", oac = " ")
         reset_options();
         opts.brace_style = 'collapse,preserve-inline';
-        bt('var a =\n{\na: 2\n}\n;\nvar a =\n{\na: 2\n}\n;', 'var a = {\n    a: 2\n};\nvar a = {\n    a: 2\n};');
-        bt('//case 1\nif (a == 1)\n{}\n//case 2\nelse if (a == 2)\n{}', '//case 1\nif (a == 1) {}\n//case 2\nelse if (a == 2) {}');
+        bt(
+            'var a =\n{\na: 2\n}\n;\n' +
+            'var a =\n{\na: 2\n}\n;',
+            //  -- output --
+            'var a = {\n    a: 2\n};\n' +
+            'var a = {\n    a: 2\n};');
+        bt(
+            '//case 1\n' +
+            'if (a == 1)\n{}\n' +
+            '//case 2\n' +
+            'else if (a == 2)\n{}',
+            //  -- output --
+            '//case 1\n' +
+            'if (a == 1) {}\n' +
+            '//case 2\n' +
+            'else if (a == 2) {}');
         bt('if(1)\n{\n2\n}\nelse\n{\n3\n}', 'if (1) {\n    2\n} else {\n    3\n}');
         bt('try\n{\na();\n}\ncatch(b)\n{\nc();\n}\ncatch(d)\n{}\nfinally\n{\ne();\n}', 'try {\n    a();\n} catch (b) {\n    c();\n} catch (d) {} finally {\n    e();\n}');
 
         // Brace style permutations - (ibo = "", iao = "", ibc = "", iac = "", obo = " ", oao = "\n    ", obc = "\n", oac = " ")
         reset_options();
         opts.brace_style = 'collapse';
-        bt('var a ={a: 2};\nvar a ={a: 2};', 'var a = {\n    a: 2\n};\nvar a = {\n    a: 2\n};');
-        bt('//case 1\nif (a == 1){}\n//case 2\nelse if (a == 2){}', '//case 1\nif (a == 1) {}\n//case 2\nelse if (a == 2) {}');
+        bt(
+            'var a ={a: 2};\n' +
+            'var a ={a: 2};',
+            //  -- output --
+            'var a = {\n    a: 2\n};\n' +
+            'var a = {\n    a: 2\n};');
+        bt(
+            '//case 1\n' +
+            'if (a == 1){}\n' +
+            '//case 2\n' +
+            'else if (a == 2){}',
+            //  -- output --
+            '//case 1\n' +
+            'if (a == 1) {}\n' +
+            '//case 2\n' +
+            'else if (a == 2) {}');
         bt('if(1){2}else{3}', 'if (1) {\n    2\n} else {\n    3\n}');
         bt('try{a();}catch(b){c();}catch(d){}finally{e();}', 'try {\n    a();\n} catch (b) {\n    c();\n} catch (d) {} finally {\n    e();\n}');
 
         // Brace style permutations - (ibo = "\n", iao = "\n", ibc = "\n", iac = "\n", obo = " ", oao = "\n    ", obc = "\n", oac = " ")
         reset_options();
         opts.brace_style = 'collapse';
-        bt('var a =\n{\na: 2\n}\n;\nvar a =\n{\na: 2\n}\n;', 'var a = {\n    a: 2\n};\nvar a = {\n    a: 2\n};');
-        bt('//case 1\nif (a == 1)\n{}\n//case 2\nelse if (a == 2)\n{}', '//case 1\nif (a == 1) {}\n//case 2\nelse if (a == 2) {}');
+        bt(
+            'var a =\n{\na: 2\n}\n;\n' +
+            'var a =\n{\na: 2\n}\n;',
+            //  -- output --
+            'var a = {\n    a: 2\n};\n' +
+            'var a = {\n    a: 2\n};');
+        bt(
+            '//case 1\n' +
+            'if (a == 1)\n{}\n' +
+            '//case 2\n' +
+            'else if (a == 2)\n{}',
+            //  -- output --
+            '//case 1\n' +
+            'if (a == 1) {}\n' +
+            '//case 2\n' +
+            'else if (a == 2) {}');
         bt('if(1)\n{\n2\n}\nelse\n{\n3\n}', 'if (1) {\n    2\n} else {\n    3\n}');
         bt('try\n{\na();\n}\ncatch(b)\n{\nc();\n}\ncatch(d)\n{}\nfinally\n{\ne();\n}', 'try {\n    a();\n} catch (b) {\n    c();\n} catch (d) {} finally {\n    e();\n}');
 
@@ -489,26 +583,88 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         // Comma-first option - (c0 = ",\n", c1 = ",\n    ", c2 = ",\n        ", c3 = ",\n            ", f1 = "    ,\n    ")
         reset_options();
         opts.comma_first = false;
-        bt('{a:1, b:2}', '{\n    a: 1,\n    b: 2\n}');
+        bt(
+            '{a:1, b:2}',
+            //  -- output --
+            '{\n' +
+            '    a: 1,\n    b: 2\n' +
+            '}');
         bt('var a=1, b=c[d], e=6;', 'var a = 1,\n    b = c[d],\n    e = 6;');
-        bt('for(var a=1,b=2,c=3;d<3;d++)\ne', 'for (var a = 1, b = 2, c = 3; d < 3; d++)\n    e');
-        bt('for(var a=1,b=2,\nc=3;d<3;d++)\ne', 'for (var a = 1, b = 2,\n        c = 3; d < 3; d++)\n    e');
-        bt('function foo() {\n    return [\n        "one",\n        "two"\n    ];\n}');
-        bt('a=[[1,2],[4,5],[7,8]]', 'a = [\n    [1, 2],\n    [4, 5],\n    [7, 8]\n]');
-        bt('a=[[1,2],[4,5],[7,8],]', 'a = [\n    [1, 2],\n    [4, 5],\n    [7, 8],\n]');
-        bt('a=[[1,2],[4,5],function(){},[7,8]]', 'a = [\n    [1, 2],\n    [4, 5],\n    function() {},\n    [7, 8]\n]');
-        bt('a=[[1,2],[4,5],function(){},function(){},[7,8]]', 'a = [\n    [1, 2],\n    [4, 5],\n    function() {},\n    function() {},\n    [7, 8]\n]');
-        bt('a=[[1,2],[4,5],function(){},[7,8]]', 'a = [\n    [1, 2],\n    [4, 5],\n    function() {},\n    [7, 8]\n]');
+        bt(
+            'for(var a=1,b=2,c=3;d<3;d++)\n' +
+            'e',
+            //  -- output --
+            'for (var a = 1, b = 2, c = 3; d < 3; d++)\n' +
+            '    e');
+        bt(
+            'for(var a=1,b=2,\n' +
+            'c=3;d<3;d++)\n' +
+            'e',
+            //  -- output --
+            'for (var a = 1, b = 2,\n        c = 3; d < 3; d++)\n' +
+            '    e');
+        bt(
+            'function foo() {\n' +
+            '    return [\n' +
+            '        "one",\n        "two"\n' +
+            '    ];\n' +
+            '}');
+        bt(
+            'a=[[1,2],[4,5],[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2],\n    [4, 5],\n    [7, 8]\n' +
+            ']');
+        bt(
+            'a=[[1,2],[4,5],[7,8],]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2],\n    [4, 5],\n    [7, 8],\n]');
+        bt(
+            'a=[[1,2],[4,5],function(){},[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2],\n    [4, 5],\n    function() {},\n    [7, 8]\n' +
+            ']');
+        bt(
+            'a=[[1,2],[4,5],function(){},function(){},[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2],\n    [4, 5],\n    function() {},\n    function() {},\n    [7, 8]\n' +
+            ']');
+        bt(
+            'a=[[1,2],[4,5],function(){},[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2],\n    [4, 5],\n    function() {},\n    [7, 8]\n' +
+            ']');
         bt('a=[b,c,function(){},function(){},d]', 'a = [b, c, function() {}, function() {}, d]');
-        bt('a=[b,c,\nfunction(){},function(){},d]', 'a = [b, c,\n    function() {},\n    function() {},\n    d\n]');
+        bt(
+            'a=[b,c,\n' +
+            'function(){},function(){},d]',
+            //  -- output --
+            'a = [b, c,\n    function() {},\n    function() {},\n    d\n' +
+            ']');
         bt('a=[a[1],b[4],c[d[7]]]', 'a = [a[1], b[4], c[d[7]]]');
         bt('[1,2,[3,4,[5,6],7],8]', '[1, 2, [3, 4, [5, 6], 7], 8]');
-        bt('[[["1","2"],["3","4"]],[["5","6","7"],["8","9","0"]],[["1","2","3"],["4","5","6","7"],["8","9","0"]]]', '[\n    [\n        ["1", "2"],\n        ["3", "4"]\n    ],\n    [\n        ["5", "6", "7"],\n        ["8", "9", "0"]\n    ],\n    [\n        ["1", "2", "3"],\n        ["4", "5", "6", "7"],\n        ["8", "9", "0"]\n    ]\n]');
+        bt(
+            '[[["1","2"],["3","4"]],[["5","6","7"],["8","9","0"]],[["1","2","3"],["4","5","6","7"],["8","9","0"]]]',
+            //  -- output --
+            '[\n' +
+            '    [\n' +
+            '        ["1", "2"],\n        ["3", "4"]\n' +
+            '    ],\n    [\n' +
+            '        ["5", "6", "7"],\n        ["8", "9", "0"]\n' +
+            '    ],\n    [\n' +
+            '        ["1", "2", "3"],\n        ["4", "5", "6", "7"],\n        ["8", "9", "0"]\n' +
+            '    ]\n' +
+            ']');
         bt(
             'changeCollection.add({\n' +
             '    name: "Jonathan" // New line inserted after this line on every save\n' +
             '    , age: 25\n' +
             '});',
+            //  -- output --
             'changeCollection.add({\n' +
             '    name: "Jonathan" // New line inserted after this line on every save\n' +
             '        ,\n    age: 25\n' +
@@ -522,6 +678,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '        return true;\n' +
             '    }\n' +
             ');',
+            //  -- output --
             'changeCollection.add(\n' +
             '    function() {\n' +
             '        return true;\n' +
@@ -533,21 +690,82 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         // Comma-first option - (c0 = "\n, ", c1 = "\n    , ", c2 = "\n        , ", c3 = "\n            , ", f1 = ", ")
         reset_options();
         opts.comma_first = true;
-        bt('{a:1, b:2}', '{\n    a: 1\n    , b: 2\n}');
+        bt(
+            '{a:1, b:2}',
+            //  -- output --
+            '{\n' +
+            '    a: 1\n    , b: 2\n' +
+            '}');
         bt('var a=1, b=c[d], e=6;', 'var a = 1\n    , b = c[d]\n    , e = 6;');
-        bt('for(var a=1,b=2,c=3;d<3;d++)\ne', 'for (var a = 1, b = 2, c = 3; d < 3; d++)\n    e');
-        bt('for(var a=1,b=2,\nc=3;d<3;d++)\ne', 'for (var a = 1, b = 2\n        , c = 3; d < 3; d++)\n    e');
-        bt('function foo() {\n    return [\n        "one"\n        , "two"\n    ];\n}');
-        bt('a=[[1,2],[4,5],[7,8]]', 'a = [\n    [1, 2]\n    , [4, 5]\n    , [7, 8]\n]');
-        bt('a=[[1,2],[4,5],[7,8],]', 'a = [\n    [1, 2]\n    , [4, 5]\n    , [7, 8]\n, ]');
-        bt('a=[[1,2],[4,5],function(){},[7,8]]', 'a = [\n    [1, 2]\n    , [4, 5]\n    , function() {}\n    , [7, 8]\n]');
-        bt('a=[[1,2],[4,5],function(){},function(){},[7,8]]', 'a = [\n    [1, 2]\n    , [4, 5]\n    , function() {}\n    , function() {}\n    , [7, 8]\n]');
-        bt('a=[[1,2],[4,5],function(){},[7,8]]', 'a = [\n    [1, 2]\n    , [4, 5]\n    , function() {}\n    , [7, 8]\n]');
+        bt(
+            'for(var a=1,b=2,c=3;d<3;d++)\n' +
+            'e',
+            //  -- output --
+            'for (var a = 1, b = 2, c = 3; d < 3; d++)\n' +
+            '    e');
+        bt(
+            'for(var a=1,b=2,\n' +
+            'c=3;d<3;d++)\n' +
+            'e',
+            //  -- output --
+            'for (var a = 1, b = 2\n        , c = 3; d < 3; d++)\n' +
+            '    e');
+        bt(
+            'function foo() {\n' +
+            '    return [\n' +
+            '        "one"\n        , "two"\n' +
+            '    ];\n' +
+            '}');
+        bt(
+            'a=[[1,2],[4,5],[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2]\n    , [4, 5]\n    , [7, 8]\n' +
+            ']');
+        bt(
+            'a=[[1,2],[4,5],[7,8],]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2]\n    , [4, 5]\n    , [7, 8]\n, ]');
+        bt(
+            'a=[[1,2],[4,5],function(){},[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2]\n    , [4, 5]\n    , function() {}\n    , [7, 8]\n' +
+            ']');
+        bt(
+            'a=[[1,2],[4,5],function(){},function(){},[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2]\n    , [4, 5]\n    , function() {}\n    , function() {}\n    , [7, 8]\n' +
+            ']');
+        bt(
+            'a=[[1,2],[4,5],function(){},[7,8]]',
+            //  -- output --
+            'a = [\n' +
+            '    [1, 2]\n    , [4, 5]\n    , function() {}\n    , [7, 8]\n' +
+            ']');
         bt('a=[b,c,function(){},function(){},d]', 'a = [b, c, function() {}, function() {}, d]');
-        bt('a=[b,c,\nfunction(){},function(){},d]', 'a = [b, c\n    , function() {}\n    , function() {}\n    , d\n]');
+        bt(
+            'a=[b,c,\n' +
+            'function(){},function(){},d]',
+            //  -- output --
+            'a = [b, c\n    , function() {}\n    , function() {}\n    , d\n' +
+            ']');
         bt('a=[a[1],b[4],c[d[7]]]', 'a = [a[1], b[4], c[d[7]]]');
         bt('[1,2,[3,4,[5,6],7],8]', '[1, 2, [3, 4, [5, 6], 7], 8]');
-        bt('[[["1","2"],["3","4"]],[["5","6","7"],["8","9","0"]],[["1","2","3"],["4","5","6","7"],["8","9","0"]]]', '[\n    [\n        ["1", "2"]\n        , ["3", "4"]\n    ]\n    , [\n        ["5", "6", "7"]\n        , ["8", "9", "0"]\n    ]\n    , [\n        ["1", "2", "3"]\n        , ["4", "5", "6", "7"]\n        , ["8", "9", "0"]\n    ]\n]');
+        bt(
+            '[[["1","2"],["3","4"]],[["5","6","7"],["8","9","0"]],[["1","2","3"],["4","5","6","7"],["8","9","0"]]]',
+            //  -- output --
+            '[\n' +
+            '    [\n' +
+            '        ["1", "2"]\n        , ["3", "4"]\n' +
+            '    ]\n    , [\n' +
+            '        ["5", "6", "7"]\n        , ["8", "9", "0"]\n' +
+            '    ]\n    , [\n' +
+            '        ["1", "2", "3"]\n        , ["4", "5", "6", "7"]\n        , ["8", "9", "0"]\n' +
+            '    ]\n' +
+            ']');
         bt(
             'changeCollection.add({\n' +
             '    name: "Jonathan" // New line inserted after this line on every save\n' +
@@ -562,6 +780,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '        return true;\n' +
             '    }\n' +
             ');',
+            //  -- output --
             'changeCollection.add(\n' +
             '    function() {\n' +
             '        return true;\n' +
@@ -577,9 +796,28 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         opts.space_in_paren = false;
         opts.space_in_empty_paren = false;
         bt('if(p) foo(a,b);', 'if (p) foo(a, b);');
-        bt('try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }', 'try {\n    while (true) {\n        willThrow()\n    }\n} catch (result) switch (result) {\n    case 1:\n        ++result\n}');
+        bt(
+            'try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }',
+            //  -- output --
+            'try {\n' +
+            '    while (true) {\n' +
+            '        willThrow()\n' +
+            '    }\n' +
+            '} catch (result) switch (result) {\n' +
+            '    case 1:\n' +
+            '        ++result\n' +
+            '}');
         bt('((e/((a+(b)*c)-d))^2)*5;', '((e / ((a + (b) * c) - d)) ^ 2) * 5;');
-        bt('function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}', 'function f(a, b) {\n    if (a) b()\n}\n\nfunction g(a, b) {\n    if (!a) b()\n}');
+        bt(
+            'function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}',
+            //  -- output --
+            'function f(a, b) {\n' +
+            '    if (a) b()\n' +
+            '}\n' +
+            '\n' +
+            'function g(a, b) {\n' +
+            '    if (!a) b()\n' +
+            '}');
         bt('a=[];', 'a = [];');
         bt('a=[b,c,d];', 'a = [b, c, d];');
         bt('a= f[b];', 'a = f[b];');
@@ -592,6 +830,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '        dest: "www/gui/build"\n' +
             '    } ]\n' +
             '}',
+            //  -- output --
             '{\n' +
             '    files: [{\n' +
             '        expand: true,\n' +
@@ -606,9 +845,28 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         opts.space_in_paren = false;
         opts.space_in_empty_paren = true;
         bt('if(p) foo(a,b);', 'if (p) foo(a, b);');
-        bt('try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }', 'try {\n    while (true) {\n        willThrow()\n    }\n} catch (result) switch (result) {\n    case 1:\n        ++result\n}');
+        bt(
+            'try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }',
+            //  -- output --
+            'try {\n' +
+            '    while (true) {\n' +
+            '        willThrow()\n' +
+            '    }\n' +
+            '} catch (result) switch (result) {\n' +
+            '    case 1:\n' +
+            '        ++result\n' +
+            '}');
         bt('((e/((a+(b)*c)-d))^2)*5;', '((e / ((a + (b) * c) - d)) ^ 2) * 5;');
-        bt('function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}', 'function f(a, b) {\n    if (a) b()\n}\n\nfunction g(a, b) {\n    if (!a) b()\n}');
+        bt(
+            'function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}',
+            //  -- output --
+            'function f(a, b) {\n' +
+            '    if (a) b()\n' +
+            '}\n' +
+            '\n' +
+            'function g(a, b) {\n' +
+            '    if (!a) b()\n' +
+            '}');
         bt('a=[];', 'a = [];');
         bt('a=[b,c,d];', 'a = [b, c, d];');
         bt('a= f[b];', 'a = f[b];');
@@ -621,6 +879,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '        dest: "www/gui/build"\n' +
             '    } ]\n' +
             '}',
+            //  -- output --
             '{\n' +
             '    files: [{\n' +
             '        expand: true,\n' +
@@ -635,9 +894,28 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         opts.space_in_paren = true;
         opts.space_in_empty_paren = false;
         bt('if(p) foo(a,b);', 'if ( p ) foo( a, b );');
-        bt('try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }', 'try {\n    while ( true ) {\n        willThrow()\n    }\n} catch ( result ) switch ( result ) {\n    case 1:\n        ++result\n}');
+        bt(
+            'try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }',
+            //  -- output --
+            'try {\n' +
+            '    while ( true ) {\n' +
+            '        willThrow()\n' +
+            '    }\n' +
+            '} catch ( result ) switch ( result ) {\n' +
+            '    case 1:\n' +
+            '        ++result\n' +
+            '}');
         bt('((e/((a+(b)*c)-d))^2)*5;', '( ( e / ( ( a + ( b ) * c ) - d ) ) ^ 2 ) * 5;');
-        bt('function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}', 'function f( a, b ) {\n    if ( a ) b()\n}\n\nfunction g( a, b ) {\n    if ( !a ) b()\n}');
+        bt(
+            'function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}',
+            //  -- output --
+            'function f( a, b ) {\n' +
+            '    if ( a ) b()\n' +
+            '}\n' +
+            '\n' +
+            'function g( a, b ) {\n' +
+            '    if ( !a ) b()\n' +
+            '}');
         bt('a=[];', 'a = [];');
         bt('a=[b,c,d];', 'a = [ b, c, d ];');
         bt('a= f[b];', 'a = f[ b ];');
@@ -656,9 +934,28 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         opts.space_in_paren = true;
         opts.space_in_empty_paren = true;
         bt('if(p) foo(a,b);', 'if ( p ) foo( a, b );');
-        bt('try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }', 'try {\n    while ( true ) {\n        willThrow( )\n    }\n} catch ( result ) switch ( result ) {\n    case 1:\n        ++result\n}');
+        bt(
+            'try{while(true){willThrow()}}catch(result)switch(result){case 1:++result }',
+            //  -- output --
+            'try {\n' +
+            '    while ( true ) {\n' +
+            '        willThrow( )\n' +
+            '    }\n' +
+            '} catch ( result ) switch ( result ) {\n' +
+            '    case 1:\n' +
+            '        ++result\n' +
+            '}');
         bt('((e/((a+(b)*c)-d))^2)*5;', '( ( e / ( ( a + ( b ) * c ) - d ) ) ^ 2 ) * 5;');
-        bt('function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}', 'function f( a, b ) {\n    if ( a ) b( )\n}\n\nfunction g( a, b ) {\n    if ( !a ) b( )\n}');
+        bt(
+            'function f(a,b) {if(a) b()}function g(a,b) {if(!a) b()}',
+            //  -- output --
+            'function f( a, b ) {\n' +
+            '    if ( a ) b( )\n' +
+            '}\n' +
+            '\n' +
+            'function g( a, b ) {\n' +
+            '    if ( !a ) b( )\n' +
+            '}');
         bt('a=[];', 'a = [ ];');
         bt('a=[b,c,d];', 'a = [ b, c, d ];');
         bt('a= f[b];', 'a = f[ b ];');
@@ -715,6 +1012,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             'ab;\n' +
             'ac +\n' +
             '-ad',
+            //  -- output --
             'var res = a + b - c / d * e % f;\n' +
             'var res = g & h | i ^ j;\n' +
             'var res = (k && l || m) ? n : o;\n' +
@@ -763,6 +1061,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             'ab;\n' +
             'ac +\n' +
             '-ad',
+            //  -- output --
             'var res = a + b - c / d * e % f;\n' +
             'var res = g & h | i ^ j;\n' +
             'var res = (k && l || m) ? n : o;\n' +
@@ -811,6 +1110,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             'ab;\n' +
             'ac +\n' +
             '-ad',
+            //  -- output --
             'var res = a + b - c / d * e % f;\n' +
             'var res = g & h | i ^ j;\n' +
             'var res = (k && l || m) ? n : o;\n' +
@@ -854,6 +1154,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             'ab;\n' +
             'ac +\n' +
             '-ad',
+            //  -- output --
             'var res = a + b -\n' +
             '    c /\n' +
             '    d * e %\n' +
@@ -894,6 +1195,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             ': h;\n' +
             'var i = j ? k :\n' +
             'l;',
+            //  -- output --
             'var a = {\n' +
             '    b: bval,\n' +
             '    c: cval,\n' +
@@ -921,6 +1223,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '        anOcean\n' +
             '        || aRiver);\n' +
             '}',
+            //  -- output --
             'var d = 1;\n' +
             'if (a === b &&\n' +
             '    c) {\n' +
@@ -974,6 +1277,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             'ab;\n' +
             'ac +\n' +
             '-ad',
+            //  -- output --
             'var res = a + b\n' +
             '    - c\n' +
             '    / d * e\n' +
@@ -1013,6 +1317,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             ': h;\n' +
             'var i = j ? k :\n' +
             'l;',
+            //  -- output --
             'var a = {\n' +
             '    b: bval,\n' +
             '    c: cval,\n' +
@@ -1040,6 +1345,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '        anOcean\n' +
             '        || aRiver);\n' +
             '}',
+            //  -- output --
             'var d = 1;\n' +
             'if (a === b\n' +
             '    && c) {\n' +
@@ -1093,6 +1399,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             'ab;\n' +
             'ac +\n' +
             '-ad',
+            //  -- output --
             'var res = a + b\n' +
             '    - c /\n' +
             '    d * e\n' +
@@ -1134,6 +1441,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             ': h;\n' +
             'var i = j ? k :\n' +
             'l;',
+            //  -- output --
             'var a = {\n' +
             '    b: bval,\n' +
             '    c: cval,\n' +
@@ -1183,15 +1491,26 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         reset_options();
         bt('async function foo() {}');
         bt('let w = async function foo() {}');
-        bt('async function foo() {}\nvar x = await foo();');
+        bt(
+            'async function foo() {}\n' +
+            'var x = await foo();');
         
         // async function as an input to another function
         bt('wrapper(async function foo() {})');
         
         // await on inline anonymous function. should have a space after await
         bt(
-            'async function() {\n    var w = await(async function() {\n        return await foo();\n    })();\n}',
-            'async function() {\n    var w = await (async function() {\n        return await foo();\n    })();\n}');
+            'async function() {\n' +
+            '    var w = await(async function() {\n' +
+            '        return await foo();\n' +
+            '    })();\n' +
+            '}',
+            //  -- output --
+            'async function() {\n' +
+            '    var w = await (async function() {\n' +
+            '        return await foo();\n' +
+            '    })();\n' +
+            '}');
         
         // ensure that this doesn't break anyone with the async library
         bt('async.map(function(t) {})');
@@ -1201,7 +1520,12 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         // e4x - Test that e4x literals passed through when e4x-option is enabled
         reset_options();
         opts.e4x = true;
-        bt('xml=\n foox;', 'xml = \n foox;');
+        bt(
+            'xml=\n' +
+            ' foox;',
+            //  -- output --
+            'xml = \n' +
+            ' foox;');
         bt('');
         bt('');
         bt('');
@@ -1209,8 +1533,20 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         bt('');
         
         // Handles inline expressions
-        bt('xml=<{a} b="c">\n foox;', 'xml = <{a} b="c">\n foox;');
-        bt('xml=<{a} b="c">\n    \n foox;', 'xml = <{a} b="c">\n    \n foox;');
+        bt(
+            'xml=<{a} b="c">\n' +
+            ' foox;',
+            //  -- output --
+            'xml = <{a} b="c">\n' +
+            ' foox;');
+        bt(
+            'xml=<{a} b="c">\n' +
+            '    \n' +
+            ' foox;',
+            //  -- output --
+            'xml = <{a} b="c">\n' +
+            '    \n' +
+            ' foox;');
         
         // xml literals with special characters in elem names - see http://www.w3.org/TR/REC-xml/#NT-NameChar
         bt('xml = <_:.valid.xml- _:.valid.xml-="123"/>;');
@@ -1219,7 +1555,12 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
         bt('xml = ;');
         
         // Handles CDATA
-        bt('xml=\n foox/]]>;', 'xml = \n foox/]]>;');
+        bt(
+            'xml=\n' +
+            ' foox/]]>;',
+            //  -- output --
+            'xml = \n' +
+            ' foox/]]>;');
         bt('xml=;', 'xml = ;');
         bt('xml=;', 'xml = ;');
         
@@ -1373,6 +1714,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '    }\n' +
             '});\n' +
             'React.render(, mountNode);',
+            //  -- output --
             'var converter = new Showdown.converter();\n' +
             'var MarkdownEditor = React.createClass({\n' +
             '    getInitialState: function() {\n' +
@@ -1420,6 +1762,7 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
             '    );\n' +
             'var qwer =  A dropdown list  Do Something Do Something Fun! Do Something Else  ;\n' +
             'render(dropdown);',
+            //  -- output --
             'var content = (\n' +
             '