diff options
Diffstat (limited to 'js/src/jit-test/tests/regexp_parse/Lookahead.js')
-rw-r--r-- | js/src/jit-test/tests/regexp_parse/Lookahead.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/regexp_parse/Lookahead.js b/js/src/jit-test/tests/regexp_parse/Lookahead.js new file mode 100644 index 000000000..96fc20fe9 --- /dev/null +++ b/js/src/jit-test/tests/regexp_parse/Lookahead.js @@ -0,0 +1,31 @@ +if (typeof parseRegExp === 'undefined') + quit(); + +load(libdir + "regexp_parse.js"); + +test_mix("(?=abc)", all_flags, + Lookahead(Atom("abc"))); + +test_mix("(?!abc)", all_flags, + NegativeLookahead(Atom("abc"))); + +test_mix("(?=abc)+", no_unicode_flags, + Lookahead(Atom("abc"))); + +// Lookahead becomes Empty because max_match of Lookahead is 0 and the min vaue +// of Quantifier is also 0. +test("(?=abc)*", no_unicode_flags, + Empty()); +test("X(?=abc)*Y", no_unicode_flags, + Alternative([ + Atom("X"), + Atom("Y"), + ])); + +test("(?=abc)?", no_unicode_flags, + Empty()); +test("X(?=abc)?Y", no_unicode_flags, + Alternative([ + Atom("X"), + Atom("Y"), + ])); |