| 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 QuantifierPrefix :: + evaluates by returning the two |
| 7 |
results 1 and \infty |
| 8 |
es5id: 15.10.2.7_A3_T13 |
| 9 |
description: Execute /(b+)(b*)/.exec("abbbbbbbc") and check results |
| 10 |
---*/ |
| 11 |
|
| 12 |
var __executed = /(b+)(b*)/.exec("abbbbbbbc"); |
| 13 |
|
| 14 |
var __expected = ["bbbbbbb","bbbbbbb",""]; |
| 15 |
__expected.index = 1; |
| 16 |
__expected.input = "abbbbbbbc"; |
| 17 |
|
| 18 |
//CHECK#1 |
| 19 |
if (__executed.length !== __expected.length) { |
| 20 |
$ERROR('#1: __executed = /(b+)(b*)/.exec("abbbbbbbc"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); |
| 21 |
} |
| 22 |
|
| 23 |
//CHECK#2 |
| 24 |
if (__executed.index !== __expected.index) { |
| 25 |
$ERROR('#2: __executed = /(b+)(b*)/.exec("abbbbbbbc"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); |
| 26 |
} |
| 27 |
|
| 28 |
//CHECK#3 |
| 29 |
if (__executed.input !== __expected.input) { |
| 30 |
$ERROR('#3: __executed = /(b+)(b*)/.exec("abbbbbbbc"); __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 = /(b+)(b*)/.exec("abbbbbbbc"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); |
| 37 |
} |
| 38 |
} |