Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.12_A6_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 The production CharacterClassEscape :: D evaluates by returning the set of all characters not
7 included in the set returned by CharacterClassEscape :: d
8 es5id: 15.10.2.12_A6_T2
9 description: ENGLISH ALPHABET
10 ---*/
11
12 var regexp_D = /\D/;
13
14 //CHECK#0041-005A
15 var result = true;
16 for (var alpha = 0x0041; alpha <= 0x005A; alpha++) {
17 var str = String.fromCharCode(alpha);
18 var arr = regexp_D.exec(str);
19 if ((arr === null) || (arr[0] !== str)) {
20 result = false;
21 }
22 }
23
24 if (result !== true) {
25 $ERROR('#1: ENGLISH CAPITAL ALPHABET');
26 }
27
28 //CHECK#0061-007A
29 var result = true;
30 for (alpha = 0x0061; alpha <= 0x007A; alpha++) {
31 str = String.fromCharCode(alpha);
32 arr = regexp_D.exec(str);
33 if ((arr === null) || (arr[0] !== str)) {
34 result = false;
35 }
36 }
37
38 if (result !== true) {
39 $ERROR('#2: english small alphabet');
40 }