| 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_T7 |
| 10 |
description: Execute /(\.(?!com|org)|\/)/.exec("ah/info") and check results |
| 11 |
---*/ |
| 12 |
|
| 13 |
var __executed = /(\.(?!com|org)|\/)/.exec("ah/info"); |
| 14 |
|
| 15 |
var __expected = ['/', '/']; |
| 16 |
__expected.index = 2; |
| 17 |
__expected.input = "ah/info"; |
| 18 |
|
| 19 |
//CHECK#1 |
| 20 |
if (__executed.length !== __expected.length) { |
| 21 |
$ERROR('#1: __executed = /(\\.(?!com|org)|\\/)/.exec("ah/info"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); |
| 22 |
} |
| 23 |
|
| 24 |
//CHECK#2 |
| 25 |
if (__executed.index !== __expected.index) { |
| 26 |
$ERROR('#2: __executed = /(\\.(?!com|org)|\\/)/.exec("ah/info"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); |
| 27 |
} |
| 28 |
|
| 29 |
//CHECK#3 |
| 30 |
if (__executed.input !== __expected.input) { |
| 31 |
$ERROR('#3: __executed = /(\\.(?!com|org)|\\/)/.exec("ah/info"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); |
| 32 |
} |
| 33 |
|
| 34 |
//CHECK#4 |
| 35 |
for(var index=0; index<__expected.length; index++) { |
| 36 |
if (__executed[index] !== __expected[index]) { |
| 37 |
$ERROR('#4: __executed = /(\\.(?!com|org)|\\/)/.exec("ah/info"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); |
| 38 |
} |
| 39 |
} |