From 106ab9369e30e8cb56d55614d33fcc9eb55c7715 Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Sat, 25 Feb 2017 00:53:09 +0100 Subject: [PATCH] fix(challenge): More robust test for "Learn how a Stack Works". --- .../coding-interview-data-structure-questions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json b/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json index 85f6880478..d4d2cb6135 100644 --- a/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json +++ b/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json @@ -63,7 +63,8 @@ "tests": [ "assert(homeworkStack.length === 4, 'message: homeworkStack should only contain 4 elements.');", "assert(homeworkStack[3] === 'CS50', 'message: The last element in homeworkStack should be \"CS50\".');", - "assert(homeworkStack.indexOf('PSY44') === -1, 'message: homeworkStack should not contain \"PSY44\".');" + "assert(homeworkStack.indexOf('PSY44') === -1, 'message: homeworkStack should not contain \"PSY44\".');", + "assert(code.match(/=/g).length === 1 && /homeworkStack\\s*=\\s*\\[\"BIO12\"\\s*,\\s*\"HIS80\"\\s*,\\s*\"MAT122\"\\s*,\\s*\"PSY44\"\\]/.test(code)), 'message: The initial declaration of the homeworkStack should not be changed.');" ], "solutions": [], "hints": [],