From 362e8254f89e440b777fb567a0625624dfab7ce5 Mon Sep 17 00:00:00 2001
From: Mainak Debnath <55401423+mainak-debnath@users.noreply.github.com>
Date: Mon, 28 Sep 2020 20:33:24 +0530
Subject: [PATCH] fix(learn): update test to allow negative arguments (#39701)
* Updated the regex in test
* Changed regex
Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
* Updated changes in regex
Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
---
.../passing-values-to-functions-with-arguments.english.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md
index 36097d5845..c52e166e94 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md
@@ -39,8 +39,7 @@ tests:
- text: functionWithArgs(7,9)
should output 16
.
testString: if(typeof functionWithArgs === "function") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16);
- text: You should call functionWithArgs
with two numbers after you define it.
- testString: assert(/^\s*functionWithArgs\s*\(\s*\d+\s*,\s*\d+\s*\)\s*/m.test(code));
-
+ testString: assert(/functionWithArgs\([-+]?\d*\.?\d*,[-+]?\d*\.?\d*\)/.test(code.replace(/\s/g, '')));
```