Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/S15.10.2.10_A4.1_T2.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 CharacterEscape :: UnicodeEscapeSequence :: u HexDigit HexDigit HexDigit
7 HexDigit
8 es5id: 15.10.2.10_A4.1_T2
9 description: >
10 Tested string include ENGLISH CAPITAL ALPHABET and english small
11 alphabet
12 ---*/
13
14 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"];
15 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"];
16 var result = true;
17 for (var index = 0; index < hex.length; index++) {
18 var arr = (new RegExp(hex[index])).exec(character[index]);
19 if ((arr === null) || (arr[0] !== character[index])) {
20 result = false;
21 }
22 }
23
24 assert.sameValue(result, true, 'The value of result is expected to be true');
25
26 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"];
27 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"];
28 var result = true;
29 for (index = 0; index < hex.length; index++) {
30 arr = (new RegExp(hex[index])).exec(character[index]);
31 if ((arr === null) || (arr[0] !== character[index])) {
32 result = false;
33 }
34 }
35
36 assert.sameValue(result, true, 'The value of result is expected to be true');
37
38 reportCompare(0, 0);