| 1 |
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ |
| 2 |
/* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 |
|
| 6 |
/* |
| 7 |
* |
| 8 |
* Date: 03 February 2003 |
| 9 |
* SUMMARY: Testing script with huge number of comments |
| 10 |
* |
| 11 |
* See http://bugzilla.mozilla.org/show_bug.cgi?id=191633 |
| 12 |
* |
| 13 |
*/ |
| 14 |
//----------------------------------------------------------------------------- |
| 15 |
var UBound = 0; |
| 16 |
var BUGNUMBER = 191633; |
| 17 |
var summary = 'Testing script with huge number of comments'; |
| 18 |
var status = ''; |
| 19 |
var statusitems = []; |
| 20 |
var actual = ''; |
| 21 |
var actualvalues = []; |
| 22 |
var expect= ''; |
| 23 |
var expectedvalues = []; |
| 24 |
|
| 25 |
|
| 26 |
status = inSection(1); |
| 27 |
actual = false; // initialize to failure |
| 28 |
var s = repeat_str("//\n", 40000); // Build a string of 40000 lines of comments |
| 29 |
eval(s + "actual = true;"); |
| 30 |
expect = true; |
| 31 |
addThis(); |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
//----------------------------------------------------------------------------- |
| 36 |
test(); |
| 37 |
//----------------------------------------------------------------------------- |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
function repeat_str(str, repeat_count) |
| 42 |
{ |
| 43 |
var arr = new Array(repeat_count); |
| 44 |
|
| 45 |
while (repeat_count != 0) |
| 46 |
arr[--repeat_count] = str; |
| 47 |
|
| 48 |
return str.concat.apply(str, arr); |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
function addThis() |
| 53 |
{ |
| 54 |
statusitems[UBound] = status; |
| 55 |
actualvalues[UBound] = actual; |
| 56 |
expectedvalues[UBound] = expect; |
| 57 |
UBound++; |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
function test() |
| 62 |
{ |
| 63 |
printBugNumber(BUGNUMBER); |
| 64 |
printStatus(summary); |
| 65 |
|
| 66 |
for (var i=0; i<UBound; i++) |
| 67 |
{ |
| 68 |
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |
| 69 |
} |
| 70 |
} |