diff options
Diffstat (limited to 'js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js')
-rw-r--r-- | js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js new file mode 100644 index 0000000000..27a2b22a82 --- /dev/null +++ b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js @@ -0,0 +1,16 @@ +// |reftest| skip -- regexp-duplicate-named-groups is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Test search function with duplicate names in alteration. +features: [regexp-duplicate-named-groups] +includes: [compareArray.js] +---*/ + +assert.compareArray(3, 'abcxyz'.search(/(?<a>x)|(?<a>y)/)); +assert.compareArray(3, 'abcxyz'.search(/(?<a>y)|(?<a>x)/)); +assert.compareArray(1, 'aybcxyz'.search(/(?<a>x)|(?<a>y)/)); +assert.compareArray(1, 'aybcxyz'.search(/(?<a>y)|(?<a>x)/)); + +reportCompare(0, 0); |