Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-191633.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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 gTestfile = 'regress-191633.js';
16 var UBound = 0;
17 var BUGNUMBER = 191633;
18 var summary = 'Testing script with huge number of comments';
19 var status = '';
20 var statusitems = [];
21 var actual = '';
22 var actualvalues = [];
23 var expect= '';
24 var expectedvalues = [];
25
26
27 status = inSection(1);
28 actual = false; // initialize to failure
29 var s = repeat_str("//\n", 40000); // Build a string of 40000 lines of comments
30 eval(s + "actual = true;");
31 expect = true;
32 addThis();
33
34
35
36 //-----------------------------------------------------------------------------
37 test();
38 //-----------------------------------------------------------------------------
39
40
41
42 function repeat_str(str, repeat_count)
43 {
44 var arr = new Array(repeat_count);
45
46 while (repeat_count != 0)
47 arr[--repeat_count] = str;
48
49 return str.concat.apply(str, arr);
50 }
51
52
53 function addThis()
54 {
55 statusitems[UBound] = status;
56 actualvalues[UBound] = actual;
57 expectedvalues[UBound] = expect;
58 UBound++;
59 }
60
61
62 function test()
63 {
64 enterFunc('test');
65 printBugNumber(BUGNUMBER);
66 printStatus(summary);
67
68 for (var i=0; i<UBound; i++)
69 {
70 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
71 }
72
73 exitFunc ('test');
74 }