From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../test262/language/literals/regexp/u-astral.js | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 js/src/tests/test262/language/literals/regexp/u-astral.js (limited to 'js/src/tests/test262/language/literals/regexp/u-astral.js') diff --git a/js/src/tests/test262/language/literals/regexp/u-astral.js b/js/src/tests/test262/language/literals/regexp/u-astral.js new file mode 100644 index 0000000000..70ab2b3cc6 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/u-astral.js @@ -0,0 +1,57 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Literal astral symbols within a pattern +es6id: 21.2.2.8.2 +info: | + 21.2.2.2 Pattern + + The production Pattern :: Disjunction evaluates as follows: + + 1. Evaluate Disjunction to obtain a Matcher m. + 2. Return an internal closure that takes two arguments, a String str + and an integer index, and performs the following steps: + 1. If Unicode is true, let Input be a List consisting of the + sequence of code points of str interpreted as a UTF-16 encoded + (6.1.4) Unicode string. Otherwise, let Input be a List consisting + of the sequence of code units that are the elements of str. Input + will be used throughout the algorithms in 21.2.2. Each element of + Input is considered to be a character. +---*/ + +assert(/𝌆{2}/u.test('𝌆𝌆'), 'quantifier application'); + +assert(/^[𝌆]$/u.test('𝌆'), 'as a ClassAtom'); + +var rangeRe = /[💩-💫]/u; +assert.sameValue( + rangeRe.test('\ud83d\udca8'), + false, + 'ClassAtom as lower range boundary, input below (U+1F4A8)' +); +assert.sameValue( + rangeRe.test('\ud83d\udca9'), + true, + 'ClassAtom as lower range boundary, input match (U+1F4A9)' +); +assert.sameValue( + rangeRe.test('\ud83d\udcaa'), + true, + 'ClassAtom as upper- and lower-range boundary, input within (U+1F4AA)' +); +assert.sameValue( + rangeRe.test('\ud83d\udcab'), + true, + 'ClassAtom as upper range boundary, input match (U+1F4AB)' +); +assert.sameValue( + rangeRe.test('\ud83d\udcac'), + false, + 'ClassAtom as upper range boundary, input above (U+1F4AC)' +); + +assert(/[^𝌆]/u.test('\ud834'), 'Negated character classes (LeadSurrogate)'); +assert(/[^𝌆]/u.test('\udf06'), 'Negated character classes (TrailSurrogate)'); + +reportCompare(0, 0); -- cgit v1.2.3