Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / js1_5 / Regress / regress-76054.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is mozilla.org code.
16  *
17  * The Initial Developer of the Original Code is
18  * Netscape Communications Corporation.
19  * Portions created by the Initial Developer are Copyright (C) 1998
20  * the Initial Developer. All Rights Reserved.
21  *
22  * Contributor(s):
23  *   pschwartau@netscape.com
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either the GNU General Public License Version 2 or later (the "GPL"), or
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
38
39 /*
40  * Date: 16 May 2001
41  *
42  * SUMMARY: Regression test for bug 76054
43  *
44  * See http://bugzilla.mozilla.org/show_bug.cgi?id=76054
45  * See http://bugzilla.mozilla.org/show_bug.cgi?id=78706
46  * All String HTML methods should be LOWER case -
47  */
48 //-----------------------------------------------------------------------------
49 var UBound = 0;
50 var BUGNUMBER = 76054;
51 var summary = 'Testing that String HTML methods produce all lower-case';
52 var statprefix = 'Currently testing String.';
53 var status = '';
54 var statusitems = [ ];
55 var actual = '';
56 var actualvalues = [ ];
57 var expect= '';
58 var expectedvalues = [ ];
59 var s = 'xyz';
60
61 status = 'anchor()';
62 actual = s.anchor();
63 expect = actual.toLowerCase();
64 addThis();
65
66 status = 'big()';
67 actual = s.big();
68 expect = actual.toLowerCase();
69 addThis();
70
71 status = 'blink()';
72 actual = s.blink();
73 expect = actual.toLowerCase();
74 addThis();
75
76 status = 'bold()';
77 actual = s.bold();
78 expect = actual.toLowerCase();
79 addThis();
80
81 status = 'italics()';
82 actual = s.italics();
83 expect = actual.toLowerCase();
84 addThis();
85
86 status = 'fixed()';
87 actual = s.fixed();
88 expect = actual.toLowerCase();
89 addThis();
90
91 status = 'fontcolor()';
92 actual = s.fontcolor();
93 expect = actual.toLowerCase();
94 addThis();
95
96 status = 'fontsize()';
97 actual = s.fontsize();
98 expect = actual.toLowerCase();
99 addThis();
100
101 status = 'link()';
102 actual = s.link();
103 expect = actual.toLowerCase();
104 addThis();
105
106 status = 'small()';
107 actual = s.small();
108 expect = actual.toLowerCase();
109 addThis();
110
111 status = 'strike()';
112 actual = s.strike();
113 expect = actual.toLowerCase();
114 addThis();
115
116 status = 'sub()';
117 actual = s.sub();
118 expect = actual.toLowerCase();
119 addThis();
120
121 status = 'sup()';
122 actual = s.sup();
123 expect = actual.toLowerCase();
124 addThis();
125
126
127 //-------------------------------------------------------------------------------------------------
128 test();
129 //-------------------------------------------------------------------------------------------------
130
131
132 function addThis()
133 {
134   statusitems[UBound] = status;
135   actualvalues[UBound] = actual;
136   expectedvalues[UBound] = expect;
137   UBound++;
138 }
139
140
141 function test()
142 {
143   enterFunc ('test');
144   printBugNumber(BUGNUMBER);
145   printStatus (summary);
146
147   for (var i = 0; i < UBound; i++)
148   {
149     reportCompare(expectedvalues[i], actualvalues[i], getStatus(i));
150   }
151
152   exitFunc ('test');
153 }
154
155
156 function getStatus(i)
157 {
158   return statprefix + statusitems[i];
159 }