diff --git a/test/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js b/test/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js new file mode 100644 index 0000000000..89911e13bf --- /dev/null +++ b/test/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, regexp-lookbehind] +includes: [compareArray.js] +---*/ + +assert(/\k/.test("k")); +assert(/\k<4>/.test("k<4>")); +assert(/\k\a)/.test("a")); + +assert(compareArray(["k"], "xxxkxxx".match(/\k/))); +assert(compareArray(["kxxx".match(/\k(?<=>)a/.test("ka")); +assert(/\k(?a")); +assert(/\k(x)/.test("kx")); diff --git a/test/built-ins/RegExp/named-groups/non-unicode-malformed.js b/test/built-ins/RegExp/named-groups/non-unicode-malformed.js index 74d319a6a2..37d47a692a 100644 --- a/test/built-ins/RegExp/named-groups/non-unicode-malformed.js +++ b/test/built-ins/RegExp/named-groups/non-unicode-malformed.js @@ -6,7 +6,7 @@ description: > Named groups in Unicode RegExps have some syntax errors and some compatibility escape fallback behavior. esid: prod-GroupSpecifier -features: [regexp-named-groups, regexp-lookbehind] +features: [regexp-named-groups] includes: [compareArray.js] ---*/ @@ -17,10 +17,7 @@ assert.throws(SyntaxError, () => eval("/(?<:a>a)/")); assert.throws(SyntaxError, () => eval("/(?a)/")); assert.throws(SyntaxError, () => eval("/(?a)(?a)/")); assert.throws(SyntaxError, () => eval("/(?a)(?b)(?a)/")); -assert(/\k/.test("k")); -assert(/\k<4>/.test("k<4>")); -assert(/\k eval("/(?.)\\k/")); assert.throws(SyntaxError, () => eval("/(?.)\\k eval("/(?.)\\k<>/")); @@ -29,16 +26,9 @@ assert.throws(SyntaxError, () => eval("/(?a)\\k/")); assert.throws(SyntaxError, () => eval("/(?a)\\k/")); assert.throws(SyntaxError, () => eval("/\\k(?a)/")); assert.throws(SyntaxError, () => eval("/\\ka)/")); -assert(/(?\a)/.test("a")); - -assert(compareArray(["k"], "xxxkxxx".match(/\k/))); -assert(compareArray(["kxxx".match(/\k(?<=>)a/.test("ka")); -assert(/\k(?a")); -assert(/\k(x)/.test("kx")); assert(/\k(?x)/.test("x")); assert.throws(SyntaxError, () => eval("/\\k(?x)/")); assert.throws(SyntaxError, () => eval("/\\k.)/"));