Fix(challenge): Escaping Quote

Changes the number of matches from the regex to accomodate
the additions added through babel and head/tail.
Also changes tail to use console.log to print out info
This commit is contained in:
Berkeley Martinez
2016-09-08 14:54:54 -07:00
parent 02f6158e95
commit 17f719de19

View File

@ -1074,24 +1074,22 @@
], ],
"releasedOn": "January 1, 2016", "releasedOn": "January 1, 2016",
"challengeSeed": [ "challengeSeed": [
"var myStr; // Change this line", "var myStr = \"\"; // Change this line",
"", "",
"" ""
], ],
"tail": [ "tail": [
"(function(){", "(function(){",
" if(typeof myStr === 'string') {", " if(typeof myStr === 'string') {",
" return \"myStr = \" + myStr;", " console.log(\"myStr = \\\"\" + myStr + \"\\\"\");",
" } else {", " } else {",
" return \"myStr is undefined\";", " console.log(\"myStr is undefined\");",
" }", " }",
"})();" "})();"
], ],
"solutions": [ "solutions": [],
"var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"
],
"tests": [ "tests": [
"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>).');", "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>).');",
"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>');" "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>');"
], ],
"type": "waypoint", "type": "waypoint",