diff options
Diffstat (limited to 'js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js')
-rw-r--r-- | js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js new file mode 100644 index 0000000000..b7dd55db09 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js @@ -0,0 +1,27 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Named groups in Unicode RegExps have some syntax errors and some + compatibility escape fallback behavior. +esid: prod-GroupSpecifier +features: [regexp-named-groups] +includes: [compareArray.js] +---*/ + +assert(/\k<a>/.test("k<a>")); +assert(/\k<4>/.test("k<4>")); +assert(/\k<a/.test("k<a")); +assert(/\k/.test("k")); + +assert(/(?<a>\a)/.test("a")); + +assert.compareArray(["k<a>"], "xxxk<a>xxx".match(/\k<a>/)); +assert.compareArray(["k<a"], "xxxk<a>xxx".match(/\k<a/)); + +assert(/\k<a>(<a>x)/.test("k<a><a>x")); +assert(/\k<a>\1/.test("k<a>\x01")); +assert(/\1(b)\k<a>/.test("bk<a>")); + +reportCompare(0, 0); |