| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
var gTestfile = 'regress-72964.js'; |
| 16 |
var i = 0; |
| 17 |
var BUGNUMBER = 72964; |
| 18 |
var summary = 'Testing regular expressions containing non-Latin1 characters'; |
| 19 |
var cnSingleSpace = ' '; |
| 20 |
var status = ''; |
| 21 |
var statusmessages = new Array(); |
| 22 |
var pattern = ''; |
| 23 |
var patterns = new Array(); |
| 24 |
var string = ''; |
| 25 |
var strings = new Array(); |
| 26 |
var actualmatch = ''; |
| 27 |
var actualmatches = new Array(); |
| 28 |
var expectedmatch = ''; |
| 29 |
var expectedmatches = new Array(); |
| 30 |
|
| 31 |
|
| 32 |
pattern = /[\S]+/; |
| 33 |
|
| 34 |
status = inSection(1); |
| 35 |
string = '\u00BF\u00CD\u00BB\u00A7'; |
| 36 |
actualmatch = string.match(pattern); |
| 37 |
expectedmatch = Array(string); |
| 38 |
addThis(); |
| 39 |
|
| 40 |
|
| 41 |
status = inSection(2); |
| 42 |
string = '\u00BF\u00CD \u00BB\u00A7'; |
| 43 |
actualmatch = string.match(pattern); |
| 44 |
expectedmatch = Array('\u00BF\u00CD'); |
| 45 |
addThis(); |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
status = inSection(3); |
| 50 |
string = '\u4e00\uac00\u4e03\u4e00'; |
| 51 |
actualmatch = string.match(pattern); |
| 52 |
expectedmatch = Array(string); |
| 53 |
addThis(); |
| 54 |
|
| 55 |
|
| 56 |
status = inSection(4); |
| 57 |
string = '\u4e00\uac00 \u4e03\u4e00'; |
| 58 |
actualmatch = string.match(pattern); |
| 59 |
expectedmatch = Array('\u4e00\uac00'); |
| 60 |
addThis(); |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
test(); |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
function addThis() |
| 71 |
{ |
| 72 |
statusmessages[i] = status; |
| 73 |
patterns[i] = pattern; |
| 74 |
strings[i] = string; |
| 75 |
actualmatches[i] = actualmatch; |
| 76 |
expectedmatches[i] = expectedmatch; |
| 77 |
i++; |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
function test() |
| 82 |
{ |
| 83 |
enterFunc ('test'); |
| 84 |
printBugNumber(BUGNUMBER); |
| 85 |
printStatus (summary); |
| 86 |
testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); |
| 87 |
exitFunc ('test'); |
| 88 |
} |