fix(curriculum): add test cases to ensure single whitespace (#49417)

* fix: update solutions regex to reflect test cases

---------

Co-authored-by: javrrr <javrrr@gmail>
This commit is contained in:
javrrr 2023-02-18 16:14:07 +02:00 committed by GitHub
parent df1eb8c8de
commit e69d78e51d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,6 +96,20 @@ reRegex.lastIndex = 0;
assert(reRegex.test('10 10 10'));
```
Your regex should not match the string `42\t42\t42`.
```js
reRegex.lastIndex = 0;
assert(!reRegex.test('42\t42\t42'));
```
Your regex should not match the string `42 42 42`.
```js
reRegex.lastIndex = 0;
assert(!reRegex.test('42 42 42'));
```
# --seed--
## --seed-contents--
@ -110,6 +124,6 @@ let result = reRegex.test(repeatNum);
```js
let repeatNum = "42 42 42";
let reRegex = /^(\d+)\s\1\s\1$/;
let reRegex = /^(\d+) \1 \1$/;
let result = reRegex.test(repeatNum);
```