Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-39309.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: 30 Sep 2003
9 * SUMMARY: Testing concatenation of string + number
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=39309
11 *
12 */
13 //-----------------------------------------------------------------------------
14 var gTestfile = 'regress-39309.js';
15 var UBound = 0;
16 var BUGNUMBER = 39309;
17 var summary = 'Testing concatenation of string + number';
18 var status = '';
19 var statusitems = [];
20 var actual = '';
21 var actualvalues = [];
22 var expect= '';
23 var expectedvalues = [];
24
25
26 function f(textProp, len)
27 {
28 var i = 0;
29 while (++i <= len)
30 {
31 var name = textProp + i;
32 actual = name;
33 }
34 }
35
36
37 status = inSection(1);
38 f('text', 1); // sets |actual|
39 expect = 'text1';
40 addThis();
41
42 status = inSection(2);
43 f('text', 100); // sets |actual|
44 expect = 'text100';
45 addThis();
46
47
48
49
50 //-----------------------------------------------------------------------------
51 test();
52 //-----------------------------------------------------------------------------
53
54
55
56 function addThis()
57 {
58 statusitems[UBound] = status;
59 actualvalues[UBound] = actual;
60 expectedvalues[UBound] = expect;
61 UBound++;
62 }
63
64
65 function test()
66 {
67 enterFunc('test');
68 printBugNumber(BUGNUMBER);
69 printStatus(summary);
70
71 for (var i=0; i<UBound; i++)
72 {
73 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
74 }
75
76 exitFunc ('test');
77 }