Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/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 //CHECK#41-5A
15 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"];
16 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"];
17 var result = true;
18 for (var index = 0; index < hex.length; index++) {
19 var arr = (new RegExp(hex[index])).exec(character[index]);
20 if ((arr === null) || (arr[0] !== character[index])) {
21 result = false;
22 }
23 }
24
25 if (result !== true) {
26 $ERROR('#1: ENGLISH CAPITAL ALPHABET');
27 }
28
29 //CHECK#61-7A
30 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"];
31 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"];
32 var result = true;
33 for (index = 0; index < hex.length; index++) {
34 arr = (new RegExp(hex[index])).exec(character[index]);
35 if ((arr === null) || (arr[0] !== character[index])) {
36 result = false;
37 }
38 }
39
40 if (result !== true) {
41 $ERROR('#1: english small alphabet');
42 }