[test262] Add staging test for RegExp named groups (search)

This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: Id8982a3d18bca219133f672736064e4d57d6da59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5294455
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92372}
This commit is contained in:
Rezvan Mahdavi Hezaveh 2024-02-16 08:19:17 -08:00 committed by test262-merge-bot
parent 903f7fc74d
commit 45e740928f
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// 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)/));