Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.8_A2_T5.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 form (?! Disjunction ) specifies a zero-width negative lookahead.
7 In order for it to succeed, the pattern inside Disjunction must fail to match at the current position.
8 The current position is not advanced before matching the sequel
9 es5id: 15.10.2.8_A2_T5
10 description: >
11 Execute /Java(?!Script)([A-Z]\w*)/.exec("JavaScr oops ipt ") and
12 check results
13 ---*/
14
15 var __executed = /Java(?!Script)([A-Z]\w*)/.exec("JavaScr oops ipt ");
16
17 var __expected = ["JavaScr", "Scr"];
18 __expected.index = 0;
19 __expected.input = "JavaScr oops ipt ";
20
21 //CHECK#1
22 if (__executed.length !== __expected.length) {
23 $ERROR('#1: __executed = /Java(?!Script)([A-Z]\\w*)/.exec("JavaScr oops ipt "); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
24 }
25
26 //CHECK#2
27 if (__executed.index !== __expected.index) {
28 $ERROR('#2: __executed = /Java(?!Script)([A-Z]\\w*)/.exec("JavaScr oops ipt "); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
29 }
30
31 //CHECK#3
32 if (__executed.input !== __expected.input) {
33 $ERROR('#3: __executed = /Java(?!Script)([A-Z]\\w*)/.exec("JavaScr oops ipt "); __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 = /Java(?!Script)([A-Z]\\w*)/.exec("JavaScr oops ipt "); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
40 }
41 }