Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit f166d4c

Browse files
adityajoshiraisedadead
authored andcommitted
fix(seed/challenges): Update test code for escaping quotes in literal strings (#16476)
Closes #16344 Closes #16332
1 parent 27e716f commit f166d4c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@
10551055
],
10561056
"solutions": [],
10571057
"tests": [
1058-
"assert(code.match(/\\\\\"/g).length === 6 && code.match(/[^\\\\]\"/g).length === 10, 'message: You should use two double quotes (<code>&quot;</code>) and four escaped double quotes (<code>&#92;&quot;</code>).');",
1058+
"assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (<code>&quot;</code>) and four escaped double quotes (<code>&#92;&quot;</code>).');",
10591059
"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
10601060
],
10611061
"type": "waypoint",
@@ -1101,12 +1101,10 @@
11011101
"tail": [
11021102
"(function() { return \"myStr = \" + myStr; })();"
11031103
],
1104-
"solutions": [
1105-
"/* head */ 'use strict'; /* solution */ var myStr = '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>'; /* tail */ (function() { return \"myStr = \" + myStr; })();"
1106-
],
1104+
"solutions": [],
11071105
"tests": [
11081106
"assert(!/\\\\/g.test(code) && myStr.match('\\\\s*<a href\\\\s*=\\\\s*\"http://www.example.com\"\\\\s*target\\\\s*=\\\\s*\"_blank\">\\\\s*Link\\\\s*</a>\\\\s*'), 'message: Remove all the <code>backslashes</code> (<code>\\</code>)');",
1109-
"assert(code.match(/\"/g).length === 6 && code.match(/'/g).length === 4, 'message: You should have two single quotes <code>&#39;</code> and four double quotes <code>&quot;</code>');"
1107+
"assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'message: You should have two single quotes <code>&#39;</code> and four double quotes <code>&quot;</code>');"
11101108
],
11111109
"type": "waypoint",
11121110
"challengeType": 1,

0 commit comments

Comments
 (0)