Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.13_A3_T1.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: Inside a CharacterClass, \b means the backspace character
6 es5id: 15.10.2.13_A3_T1
7 description: Execute /.[\b]./.exec("abc\bdef") and check results
8 ---*/
9
10 var __executed = /.[\b]./.exec("abc\bdef");
11
12 var __expected = ["c\bd"];
13 __expected.index = 2;
14 __expected.input = "abc\bdef";
15
16 //CHECK#1
17 if (__executed.length !== __expected.length) {
18 $ERROR('#1: __executed = /.[\\b]./.exec("abc\\bdef"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
19 }
20
21 //CHECK#2
22 if (__executed.index !== __expected.index) {
23 $ERROR('#2: __executed = /.[\\b]./.exec("abc\\bdef"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
24 }
25
26 //CHECK#3
27 if (__executed.input !== __expected.input) {
28 $ERROR('#3: __executed = /.[\\b]./.exec("abc\\bdef"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
29 }
30
31 //CHECK#4
32 for(var index=0; index<__expected.length; index++) {
33 if (__executed[index] !== __expected[index]) {
34 $ERROR('#4: __executed = /.[\\b]./.exec("abc\\bdef"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
35 }
36 }