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>
This commit is contained in:
Mainak Debnath
2020-09-28 20:33:24 +05:30
committed by GitHub
parent 0a0fe2bae5
commit 362e8254f8

View File

@ -39,8 +39,7 @@ tests:
- text: <code>functionWithArgs(7,9)</code> should output <code>16</code>.
testString: if(typeof functionWithArgs === "function") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16);
- text: You should call <code>functionWithArgs</code> 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, '')));
```
</section>