fix: Add tests to check lazy matching is applied and that the string "h1" is not matched (#38193)

This commit is contained in:
Ashraf Nazar 2020-02-11 16:17:51 +00:00 committed by GitHub
parent 81e751d88b
commit 5feabd762c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,10 @@ Fix the regex <code>/&lt;.*&gt;/</code> to return the HTML tag <code>&lt;h1&gt;<
tests:
- text: The <code>result</code> variable should be an array with <code>&lt;h1&gt;</code> in it
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'));
```