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