| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
var gTestfile = 'regress-187133.js'; |
| 29 |
var i = 0; |
| 30 |
var BUGNUMBER = 187133; |
| 31 |
var summary = 'RegExp conformance test'; |
| 32 |
var status = ''; |
| 33 |
var statusmessages = new Array(); |
| 34 |
var pattern = ''; |
| 35 |
var patterns = new Array(); |
| 36 |
var string = ''; |
| 37 |
var strings = new Array(); |
| 38 |
var actualmatch = ''; |
| 39 |
var actualmatches = new Array(); |
| 40 |
var expectedmatch = ''; |
| 41 |
var expectedmatches = new Array(); |
| 42 |
|
| 43 |
|
| 44 |
pattern = /(\.(?!com|org)|\/)/; |
| 45 |
status = inSection(1); |
| 46 |
string = 'ah.info'; |
| 47 |
actualmatch = string.match(pattern); |
| 48 |
expectedmatch = ['.', '.']; |
| 49 |
addThis(); |
| 50 |
|
| 51 |
status = inSection(2); |
| 52 |
string = 'ah/info'; |
| 53 |
actualmatch = string.match(pattern); |
| 54 |
expectedmatch = ['/', '/']; |
| 55 |
addThis(); |
| 56 |
|
| 57 |
status = inSection(3); |
| 58 |
string = 'ah.com'; |
| 59 |
actualmatch = string.match(pattern); |
| 60 |
expectedmatch = null; |
| 61 |
addThis(); |
| 62 |
|
| 63 |
|
| 64 |
pattern = /(?!a|b)|c/; |
| 65 |
status = inSection(4); |
| 66 |
string = ''; |
| 67 |
actualmatch = string.match(pattern); |
| 68 |
expectedmatch = ['']; |
| 69 |
addThis(); |
| 70 |
|
| 71 |
status = inSection(5); |
| 72 |
string = 'bc'; |
| 73 |
actualmatch = string.match(pattern); |
| 74 |
expectedmatch = ['']; |
| 75 |
addThis(); |
| 76 |
|
| 77 |
status = inSection(6); |
| 78 |
string = 'd'; |
| 79 |
actualmatch = string.match(pattern); |
| 80 |
expectedmatch = ['']; |
| 81 |
addThis(); |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
test(); |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
function addThis() |
| 92 |
{ |
| 93 |
statusmessages[i] = status; |
| 94 |
patterns[i] = pattern; |
| 95 |
strings[i] = string; |
| 96 |
actualmatches[i] = actualmatch; |
| 97 |
expectedmatches[i] = expectedmatch; |
| 98 |
i++; |
| 99 |
} |
| 100 |
|
| 101 |
|
| 102 |
function test() |
| 103 |
{ |
| 104 |
enterFunc ('test'); |
| 105 |
printBugNumber(BUGNUMBER); |
| 106 |
printStatus (summary); |
| 107 |
testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); |
| 108 |
exitFunc ('test'); |
| 109 |
} |