diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js')
-rw-r--r-- | js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js b/js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js new file mode 100644 index 0000000000..7cb62b2d52 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + CharacterEscape :: UnicodeEscapeSequence :: u HexDigit HexDigit HexDigit + HexDigit +es5id: 15.10.2.10_A4.1_T2 +description: > + Tested string include ENGLISH CAPITAL ALPHABET and english small + alphabet +---*/ + +var hex = ["\\u0041", "\\u0042", "\\u0043", "\\u0044", "\\u0045", "\\u0046", "\\u0047", "\\u0048", "\\u0049", "\\u004A", "\\u004B", "\\u004C", "\\u004D", "\\u004E", "\\u004F", "\\u0050", "\\u0051", "\\u0052", "\\u0053", "\\u0054", "\\u0055", "\\u0056", "\\u0057", "\\u0058", "\\u0059", "\\u005A"]; +var character = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; +var result = true; +for (var index = 0; index < hex.length; index++) { + var arr = (new RegExp(hex[index])).exec(character[index]); + if ((arr === null) || (arr[0] !== character[index])) { + result = false; + } +} + +assert.sameValue(result, true, 'The value of result is expected to be true'); + +hex = ["\\u0061", "\\u0062", "\\u0063", "\\u0064", "\\u0065", "\\u0066", "\\u0067", "\\u0068", "\\u0069", "\\u006A", "\\u006B", "\\u006C", "\\u006D", "\\u006E", "\\u006F", "\\u0070", "\\u0071", "\\u0072", "\\u0073", "\\u0074", "\\u0075", "\\u0076", "\\u0077", "\\u0078", "\\u0079", "\\u007A"]; +character = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +var result = true; +for (index = 0; index < hex.length; index++) { + arr = (new RegExp(hex[index])).exec(character[index]); + if ((arr === null) || (arr[0] !== character[index])) { + result = false; + } +} + +assert.sameValue(result, true, 'The value of result is expected to be true'); + +reportCompare(0, 0); |