From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- js/src/jit-test/tests/regexp_parse/Lookahead.js | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 js/src/jit-test/tests/regexp_parse/Lookahead.js (limited to 'js/src/jit-test/tests/regexp_parse/Lookahead.js') 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"), + ])); -- cgit v1.2.3