From a5e67245b2ac89a34a4d9f8be6942b201c311380 Mon Sep 17 00:00:00 2001 From: Thomas Wilburn Date: Tue, 4 Sep 2018 13:11:57 -0500 Subject: [PATCH 1/3] Switch back to horrible legacy multiline strings --- test/can-view-parser-test.js | 98 ++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/test/can-view-parser-test.js b/test/can-view-parser-test.js index e3cd5e5..448801a 100644 --- a/test/can-view-parser-test.js +++ b/test/can-view-parser-test.js @@ -526,80 +526,80 @@ test('> in attribute values are handled correctly', function() { //!steal-remove-start test('counts lines properly', function() { - parser(` - - -

- Header -

-
- Body Line {{line1}}
- Body Line {{line2}} - {{#if}} - {{.}} - {{/if}} -
-`, makeChecks([ - [ "chars", [ ` - `, 1 ] ], + parser("\ + \ +\ + \ + Header\ + \ +
\ + Body Line {{line1}}
\ + Body Line {{line2}}\ + {{#if}}\ + {{.}}\ + {{/if}}\ +
\ +", makeChecks([ + [ "chars", [ "\ + ", 1 ] ], [ "start", [ "style", false, 2 ] ], [ "end", [ "style", false, 2 ] ], - [ "chars", [ ` - .header { - color: black; - } - `, 2 ] ], + [ "chars", [ "\ + .header {\ + color: black;\ + }\ + ", 2 ] ], [ "close", [ "style", 6 ] ], - [ "chars", [ ` - - `, 6 ] ], + [ "chars", [ "\ +\ + ", 6 ] ], [ "start", [ "h1", false, 8 ] ], [ "attrStart", [ "class", 8 ] ], [ "attrValue", [ "header", 8 ] ], [ "attrEnd", [ "class", 8 ] ], [ "end", [ "h1", false, 10 ] ], - [ "chars", [ ` - Header - `, 10 ] ], + [ "chars", [ "\ + Header\ + ", 10 ] ], [ "close", [ "h1", 12 ] ], - [ "chars", [ ` - `, 12 ] ], + [ "chars", [ "\ + ", 12 ] ], [ "start", [ "article", false, 13 ] ], [ "end", [ "article", false, 13 ] ], - [ "chars", [ ` - Body Line `, 13 ] ], + [ "chars", [ "\ + Body Line ", 13 ] ], [ "special", [ "line1", 14 ] ], [ "start", [ "br", true, 14 ] ], [ "end", [ "br", true, 14 ] ], - [ "chars", [ ` - Body Line `, 14 ] ], + [ "chars", [ "\ + Body Line ", 14 ] ], [ "special", [ "line2", 15 ] ], - [ "chars", [ ` - `, 15 ] ], + [ "chars", [ "\ + ", 15 ] ], [ "special", [ "#if", 16 ] ], - [ "chars", [ ` - `, 16 ] ], + [ "chars", [ "\ + ", 16 ] ], [ "special", [ ".", 17 ] ], - [ "chars", [ ` - `, 17 ] ], + [ "chars", [ "\ + ", 17 ] ], [ "special", [ "/if", 18 ] ], - [ "chars", [ ` - `, 18 ] ], + [ "chars", [ "\ + ", 18 ] ], [ "close", [ "article", 19 ] ], - [ "chars", [ ` -`, 19 ] ], + [ "chars", [ "\ +", 19 ] ], [ "done", [ 20 ] ], ])); From 32e113fdc85630f871b7702944bfb73848aa2cd9 Mon Sep 17 00:00:00 2001 From: Cherif BOUCHELAGHEM Date: Fri, 26 Oct 2018 19:54:15 +0100 Subject: [PATCH 2/3] rebase again and apply fixes to in order to have a clean diff --- package.json | 2 +- test/can-view-parser-test.js | 90 ++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 52 deletions(-) diff --git a/package.json b/package.json index d469341..6ece95e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "postpublish": "git push --tags && git push", "testee": "testee test/test.html --browsers firefox", "test": "npm run detect-cycle && npm run jshint && npm run testee", - "jshint": "jshint ./*.js --config", + "jshint": "jshint test/*.js ./*.js --config", "release:pre": "npm version prerelease && npm publish --tag=pre", "release:patch": "npm version patch && npm publish", "release:minor": "npm version minor && npm publish", diff --git a/test/can-view-parser-test.js b/test/can-view-parser-test.js index 448801a..a64232e 100644 --- a/test/can-view-parser-test.js +++ b/test/can-view-parser-test.js @@ -526,80 +526,66 @@ test('> in attribute values are handled correctly', function() { //!steal-remove-start test('counts lines properly', function() { - parser("\ - \ -\ - \ - Header\ - \ -
\ - Body Line {{line1}}
\ - Body Line {{line2}}\ - {{#if}}\ - {{.}}\ - {{/if}}\ -
\ -", makeChecks([ - [ "chars", [ "\ - ", 1 ] ], + parser(" \n"+ + "\r\n"+ + "\n"+ + "\r\n"+ + "\tHeader\r\n"+ + "\r\n"+ + "
\r\n"+ + "\tBody Line {{line1}}
\r\n"+ + "\tBody Line {{line2}}\r\n"+ + "\t{{#if}}\r\n"+ + "\t\t{{.}}\r\n"+ + "\t{{/if}}\r\n"+ + "
\r\n", + makeChecks([ + [ "chars", [ " \n", 1 ] ], [ "start", [ "style", false, 2 ] ], [ "end", [ "style", false, 2 ] ], - [ "chars", [ "\ - .header {\ - color: black;\ - }\ - ", 2 ] ], + [ "chars", [ + "\r\n\t.header {\r\n"+ + "\t\tcolor: black;\r\n"+ + "\t}\r\n", 2 ] ], [ "close", [ "style", 6 ] ], - [ "chars", [ "\ -\ - ", 6 ] ], + [ "chars", [ "\r\n\n", 6 ] ], [ "start", [ "h1", false, 8 ] ], [ "attrStart", [ "class", 8 ] ], [ "attrValue", [ "header", 8 ] ], [ "attrEnd", [ "class", 8 ] ], [ "end", [ "h1", false, 10 ] ], - [ "chars", [ "\ - Header\ - ", 10 ] ], + [ "chars", [ "\r\n\tHeader\r\n", 10 ] ], [ "close", [ "h1", 12 ] ], - [ "chars", [ "\ - ", 12 ] ], + [ "chars", [ "\r\n", 12 ] ], [ "start", [ "article", false, 13 ] ], [ "end", [ "article", false, 13 ] ], - [ "chars", [ "\ - Body Line ", 13 ] ], + [ "chars", [ "\r\n\tBody Line ", 13 ] ], [ "special", [ "line1", 14 ] ], [ "start", [ "br", true, 14 ] ], [ "end", [ "br", true, 14 ] ], - [ "chars", [ "\ - Body Line ", 14 ] ], + [ "chars", [ "\r\n\tBody Line ", 14 ] ], [ "special", [ "line2", 15 ] ], - [ "chars", [ "\ - ", 15 ] ], + [ "chars", [ "\r\n\t", 15 ] ], [ "special", [ "#if", 16 ] ], - [ "chars", [ "\ - ", 16 ] ], + [ "chars", [ "\r\n\t\t", 16 ] ], [ "special", [ ".", 17 ] ], - [ "chars", [ "\ - ", 17 ] ], + [ "chars", [ "\r\n\t", 17 ] ], [ "special", [ "/if", 18 ] ], - [ "chars", [ "\ - ", 18 ] ], + [ "chars", [ "\r\n", 18 ] ], [ "close", [ "article", 19 ] ], - [ "chars", [ "\ -", 19 ] ], + [ "chars", [ "\r\n", 19 ] ], [ "done", [ 20 ] ], ])); @@ -835,7 +821,7 @@ testHelpers.dev.devOnlyTest('Fix false warning on missing closed quote (canjs/ca var makeWarnChecks = function(input, texts) { var count = 0; var teardown = testHelpers.dev.willWarn(/End quote is missing for/, function(message, matched) { - notOk(matched, texts[count++]); + QUnit.notOk(matched, texts[count++]); }); parser(input, { @@ -852,7 +838,9 @@ testHelpers.dev.devOnlyTest('Fix false warning on missing closed quote (canjs/ca equal(count, teardown()); }; + /* jshint ignore:start */ var truthy = true; + /* jshint ignore:end */ makeWarnChecks('
', [ "1: End quote is missing for current-page" @@ -897,6 +885,6 @@ test('TextNodes are not inserted before the or after the ', functi ["done", []] ]; - var html = "\n\t\n\t\tTest\n\t\t\n\t\n\t\t

Test

\n\t\n" + var html = "\n\t\n\t\tTest\n\t\t\n\t\n\t\t

Test

\n\t\n"; parser(html, makeChecks(tests)); }); From 72d7131ffe006a555263b9fe3e91fa560cb9c191 Mon Sep 17 00:00:00 2001 From: Cherif BOUCHELAGHEM Date: Fri, 26 Oct 2018 19:59:11 +0100 Subject: [PATCH 3/3] remove unused variable --- test/can-view-parser-test.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/can-view-parser-test.js b/test/can-view-parser-test.js index a64232e..84754d4 100644 --- a/test/can-view-parser-test.js +++ b/test/can-view-parser-test.js @@ -838,10 +838,6 @@ testHelpers.dev.devOnlyTest('Fix false warning on missing closed quote (canjs/ca equal(count, teardown()); }; - /* jshint ignore:start */ - var truthy = true; - /* jshint ignore:end */ - makeWarnChecks('
', [ "1: End quote is missing for current-page" ]);