2017-11-08 21:01:23 +00:00
|
|
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2017-11-17 00:45:55 +00:00
|
|
|
// Flags: --regexp-mode-modifiers
|
2017-11-08 21:01:23 +00:00
|
|
|
|
|
|
|
// S flag switches dotall mode on and off. Combine with i flag changes to test
|
|
|
|
// the parser.
|
|
|
|
test(/.(?s).(?i-s).a(?-i)a/);
|
|
|
|
test(/.(?s:.)(?i:.a)a/);
|
|
|
|
test(/.(?s).(?i-s).a(?-i)a/u);
|
|
|
|
test(/.(?s:.)(?i:.a)a/u);
|
|
|
|
|
|
|
|
// m flag makes no difference
|
|
|
|
test(/.(?sm).(?i-s).a(?-i)a/);
|
|
|
|
test(/.(?s:.)(?i:.a)a/);
|
|
|
|
test(/.(?sm).(?im-s).a(?m-i)a/u);
|
|
|
|
test(/.(?s:.)(?i:.a)a/u);
|
|
|
|
|
|
|
|
function test(re) {
|
|
|
|
assertTrue(re.test("...aa"));
|
|
|
|
assertTrue(re.test(".\n.aa"));
|
|
|
|
assertTrue(re.test(".\n.Aa"));
|
|
|
|
assertFalse(re.test("\n\n.Aa"));
|
|
|
|
assertFalse(re.test(".\n\nAa"));
|
|
|
|
assertFalse(re.test(".\n.AA"));
|
|
|
|
}
|