From 096a070ab3dc02323e136d246c7c8b713acadbf7 Mon Sep 17 00:00:00 2001
From: "L. D. MacKrell"
'); + //============================================================ + // Tests script indent behavior - (indent_scripts = ""normal"") + reset_options(); + set_name('Tests script indent behavior - (indent_scripts = ""normal"")'); + opts.indent_scripts = 'normal'; + test_fragment( + '
\n' + + '\n' + + '\n' + + '', + // -- output -- + '
\n' + + ' \n' + + ' \n' + + ''); + test_fragment( + '
'); + + // Tests script indent behavior - (indent_scripts = ""keep"") + reset_options(); + set_name('Tests script indent behavior - (indent_scripts = ""keep"")'); + opts.indent_scripts = 'keep'; + test_fragment( + '
\n' + + '\n' + + '\n' + + '', + // -- output -- + '
\n' + + ' \n' + + ' \n' + + ''); + test_fragment( + '
'); + + // Tests script indent behavior - (indent_scripts = ""separate"") + reset_options(); + set_name('Tests script indent behavior - (indent_scripts = ""separate"")'); + opts.indent_scripts = 'separate'; + test_fragment( + '
\n' + + '\n' + + '\n' + + '', + // -- output -- + '
\n' + + ' \n' + + ' \n' + + ''); + test_fragment( + '
'); + + //============================================================ // underscore.js formatting reset_options(); diff --git a/test/data/html/tests.js b/test/data/html/tests.js index 962839284..90a1e50b1 100644 --- a/test/data/html/tests.js +++ b/test/data/html/tests.js @@ -1684,6 +1684,78 @@ exports.test_data = { ] } ] + }, { + name: "Tests script indent behavior", + description: "Tests script indenting behavior", + matrix: [{ + options: [ + { name: "indent_scripts", value: "'normal'" } + ], + h: ' ', + c: ' ', + j: ' ', + hscript: ' ' + }, + { + options: [ + { name: "indent_scripts", value: "'keep'" } + ], + h: ' ', + c: ' ', + j: ' ', + hscript: ' ' + }, + { + options: [ + { name: "indent_scripts", value: "'separate'" } + ], + h: ' ', + c: ' ', + j: ' ', + hscript: '' + } + ], + tests: [{ + fragment: true, + input: [ + '
', + '', + '', + '' + ], + output: [ + '
', + '{{h}}', + '{{h}}', + '' + ] + }, + { + fragment: true, + unchanged: [ + '
' + ] + } + ] }, { name: "underscore.js formatting", description: "underscore.js templates (<% ... %>) treated as comments.",