blob: e0e5ddb36bc50a94ca298e4614ddbd1ca767a472 [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright 2009 the Sputnik authors. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3
4/*---
5info: >
6 The production QuantifierPrefix :: ? evaluates by returning the two
7 results 0 and 1
8es5id: 15.10.2.7_A5_T9
9description: Execute /b?b?b?b/.exec("abbbbc") and check results
10---*/
11
12var __executed = /b?b?b?b/.exec("abbbbc");
13
14var __expected = ["bbbb"];
15__expected.index = 1;
16__expected.input = "abbbbc";
17
18//CHECK#1
19if (__executed.length !== __expected.length) {
20 $ERROR('#1: __executed = /b?b?b?b/.exec("abbbbc"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
21}
22
23//CHECK#2
24if (__executed.index !== __expected.index) {
25 $ERROR('#2: __executed = /b?b?b?b/.exec("abbbbc"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
26}
27
28//CHECK#3
29if (__executed.input !== __expected.input) {
30 $ERROR('#3: __executed = /b?b?b?b/.exec("abbbbc"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
31}
32
33//CHECK#4
34for(var index=0; index<__expected.length; index++) {
35 if (__executed[index] !== __expected[index]) {
36 $ERROR('#4: __executed = /b?b?b?b/.exec("abbbbc"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
37 }
38}