From c4f03cce7e8fa5aa488e33fe480870369167f376 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Sat, 11 Aug 2018 21:57:25 -0700 Subject: [PATCH] Add test for html ignore directive Closes #545 Closes #994 --- js/test/generated/beautify-html-tests.js | 35 +++++++++++++++++++++++ test/data/html/tests.js | 36 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/js/test/generated/beautify-html-tests.js b/js/test/generated/beautify-html-tests.js index c06d6241..34b16faa 100644 --- a/js/test/generated/beautify-html-tests.js +++ b/js/test/generated/beautify-html-tests.js @@ -3901,6 +3901,41 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be ''); + //============================================================ + // ISSUE #575 and #994 Ignore directive works in html + reset_options(); + set_name('ISSUE #575 and #994 Ignore directive works in html'); + bth( + '\n' + + '@{\n' + + '\n' + + ' ViewBag.Title = "Dashboard";\n' + + ' string firstName = string.Empty;\n' + + ' string userId = ViewBag.UserId;\n' + + '\n' + + ' if( !string.IsNullOrEmpty(ViewBag.FirstName ) ) {\n' + + '\n' + + ' firstName = "

Hi " + ViewBag.FirstName + "

";\n' + + '\n' + + ' }\n' + + '\n' + + '}\n' + + '\n' + + '\n' + + '
\n' + + '\n' + + ' \n' + + '\n' + + ' \n' + + '\n' + + '
'); + + //============================================================ // Issue 1478 - Space handling inside self closing tag reset_options(); diff --git a/test/data/html/tests.js b/test/data/html/tests.js index 56123c6c..919678cc 100644 --- a/test/data/html/tests.js +++ b/test/data/html/tests.js @@ -1010,6 +1010,42 @@ exports.test_data = { '' ] }] + }, { + name: "ISSUE #575 and #994 Ignore directive works in html", + description: "", + options: [], + tests: [{ + unchanged: [ + '', + '@{', + '', + ' ViewBag.Title = "Dashboard";', + ' string firstName = string.Empty;', + ' string userId = ViewBag.UserId;', + '', + ' if( !string.IsNullOrEmpty(ViewBag.FirstName ) ) {', + '', + ' firstName = "

Hi " + ViewBag.FirstName + "

";', + '', + ' }', + '', + '}', + '', + '', + '
', + '', + ' ', + '', + ' ', + '', + '
' + ] + }] }, { name: "Issue 1478 - Space handling inside self closing tag", description: "Properly indent following text after self closing tags regardless of space",