Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.6_A2_T9.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 Assertion :: ^ evaluates by returning an internal
7 AssertionTester closure that takes a State argument x and performs the ...
8 es5id: 15.10.2.6_A2_T9
9 description: Execute /^\^+/.exec("^^^x") and check results
10 ---*/
11
12 var __executed = /^\^+/.exec("^^^x");
13
14 var __expected = ["^^^"];
15 __expected.index = 0;
16 __expected.input = "^^^x";
17
18 //CHECK#1
19 if (__executed.length !== __expected.length) {
20 $ERROR('#1: __executed = /^\\^+/.exec("^^^x"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
21 }
22
23 //CHECK#2
24 if (__executed.index !== __expected.index) {
25 $ERROR('#2: __executed = /^\\^+/.exec("^^^x"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
26 }
27
28 //CHECK#3
29 if (__executed.input !== __expected.input) {
30 $ERROR('#3: __executed = /^\\^+/.exec("^^^x"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
31 }
32
33 //CHECK#4
34 for(var index=0; index<__expected.length; index++) {
35 if (__executed[index] !== __expected[index]) {
36 $ERROR('#4: __executed = /^\\^+/.exec("^^^x"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
37 }
38 }