]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/String/regress-107771.js
2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is mozilla.org code.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation.
17 * All Rights Reserved.
19 * Contributor(s): ajvincent@hotmail.com, pschwartau@netscape.com
20 * Date: 31 October 2001
22 * SUMMARY: Regression test for bug 107771
23 * See http://bugzilla.mozilla.org/show_bug.cgi?id=107771
25 * The bug: Section 1 passed, but Sections 2-5 all failed with |actual| == 12
27 //-----------------------------------------------------------------------------
30 var summary
= "Regression test for bug 107771";
34 var actualvalues
= [];
36 var expectedvalues
= [];
41 status
= inSection(1);
42 str
= "AAA//BBB/CCC/";
43 k
= str
.lastIndexOf('/');
47 status
= inSection(2);
48 str
= str
.substring(0, k
);
49 k
= str
.lastIndexOf('/');
54 status
= inSection(3);
55 str
= str
.substring(0, k
);
56 k
= str
.lastIndexOf('/');
61 status
= inSection(4);
62 str
= str
.substring(0, k
);
63 k
= str
.lastIndexOf('/');
68 status
= inSection(5);
69 str
= str
.substring(0, k
);
70 k
= str
.lastIndexOf('/');
77 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
85 statusitems
[UBound
] = status
;
86 actualvalues
[UBound
] = actual
;
87 expectedvalues
[UBound
] = expect
;
96 printStatus (summary
);
98 for (var i
=0; i
<UBound
; i
++)
100 reportCompare(expectedvalues
[i
], actualvalues
[i
], statusitems
[i
]);