Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.13_A1_T13.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 CharacterClass :: [ [lookahead \notin {^}] ClassRanges ]
7 evaluates by evaluating ClassRanges to obtain a CharSet and returning
8 that CharSet and the boolean false
9 es5id: 15.10.2.13_A1_T13
10 description: >
11 Execute /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g") and
12 check results
13 ---*/
14
15 var __executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g");
16
17 var __expected = ["def"];
18 __expected.index = 15;
19 __expected.input = "a1b b2c c3d def f4g";
20
21 //CHECK#1
22 if (__executed.length !== __expected.length) {
23 $ERROR('#1: __executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
24 }
25
26 //CHECK#2
27 if (__executed.index !== __expected.index) {
28 $ERROR('#2: __executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
29 }
30
31 //CHECK#3
32 if (__executed.input !== __expected.input) {
33 $ERROR('#3: __executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
34 }
35
36 //CHECK#4
37 for(var index=0; index<__expected.length; index++) {
38 if (__executed[index] !== __expected[index]) {
39 $ERROR('#4: __executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
40 }
41 }