fix: Add tests to check lazy matching is applied and that the string "h1" is not matched (#38193)
This commit is contained in:
@ -26,6 +26,10 @@ Fix the regex <code>/<.*>/</code> to return the HTML tag <code><h1><
|
|||||||
tests:
|
tests:
|
||||||
- text: The <code>result</code> variable should be an array with <code><h1></code> in it
|
- text: The <code>result</code> variable should be an array with <code><h1></code> in it
|
||||||
testString: assert(result[0] == '<h1>');
|
testString: assert(result[0] == '<h1>');
|
||||||
|
- text: <code>myRegex</code> should use lazy matching
|
||||||
|
testString: assert(/\?/g.test(myRegex));
|
||||||
|
- text: <code>myRegex</code></code> should not include the string 'h1'
|
||||||
|
testString: assert(!myRegex.source.match('h1'));
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user