From ad6b3b86c8239d252ea028a5b2bddb4feee1954f Mon Sep 17 00:00:00 2001 From: adityajoshi Date: Thu, 18 Jan 2018 22:50:47 +0530 Subject: [PATCH] fix(seed/challenges): Update test code for escaping quotes in literal strings (#16476) Closes #16344 Closes #16332 --- .../basic-javascript.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json index 41c48b39033..b6a1a995c00 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json @@ -1055,7 +1055,7 @@ ], "solutions": [], "tests": [ - "assert(code.match(/\\\\\"/g).length === 6 && code.match(/[^\\\\]\"/g).length === 10, 'message: You should use two double quotes (") and four escaped double quotes (\").');", + "assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (") and four escaped double quotes (\").');", "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: I am a \"double quoted\" string inside \"double quotes\".');" ], "type": "waypoint", @@ -1101,12 +1101,10 @@ "tail": [ "(function() { return \"myStr = \" + myStr; })();" ], - "solutions": [ - "/* head */ 'use strict'; /* solution */ var myStr = 'Link'; /* tail */ (function() { return \"myStr = \" + myStr; })();" - ], + "solutions": [], "tests": [ "assert(!/\\\\/g.test(code) && myStr.match('\\\\s*\\\\s*Link\\\\s*\\\\s*'), 'message: Remove all the backslashes (\\)');", - "assert(code.match(/\"/g).length === 6 && code.match(/'/g).length === 4, 'message: You should have two single quotes ' and four double quotes "');" + "assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'message: You should have two single quotes ' and four double quotes "');" ], "type": "waypoint", "challengeType": 1,