Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.10_A3.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: "CharacterEscape :: HexEscapeSequence :: x HexDigit HexDigit"
6 es5id: 15.10.2.10_A3.1_T2
7 description: Checking ENGLISH CAPITAL ALPHABET and english small alphabet
8 ---*/
9
10 //CHECK#41-5A
11 var hex = ["\\x41", "\\x42", "\\x43", "\\x44", "\\x45", "\\x46", "\\x47", "\\x48", "\\x49", "\\x4A", "\\x4B", "\\x4C", "\\x4D", "\\x4E", "\\x4F", "\\x50", "\\x51", "\\x52", "\\x53", "\\x54", "\\x55", "\\x56", "\\x57", "\\x58", "\\x59", "\\x5A"];
12 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"];
13 var result = true;
14 for (var index = 0; index < hex.length; index++) {
15 var arr = (new RegExp(hex[index])).exec(character[index]);
16 if ((arr === null) || (arr[0] !== character[index])) {
17 result = false;
18 }
19 }
20
21 if (result !== true) {
22 $ERROR('#1: ENGLISH CAPITAL ALPHABET');
23 }
24
25 //CHECK#61-7A
26 hex = ["\\x61", "\\x62", "\\x63", "\\x64", "\\x65", "\\x66", "\\x67", "\\x68", "\\x69", "\\x6A", "\\x6B", "\\x6C", "\\x6D", "\\x6E", "\\x6F", "\\x70", "\\x71", "\\x72", "\\x73", "\\x74", "\\x75", "\\x76", "\\x77", "\\x78", "\\x79", "\\x7A"];
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 if (result !== true) {
37 $ERROR('#1: english small alphabet');
38 }