regress-76054.js (2565B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 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 * Date: 16 May 2001 8 * 9 * SUMMARY: Regression test for bug 76054 10 * 11 * See http://bugzilla.mozilla.org/show_bug.cgi?id=76054 12 * See http://bugzilla.mozilla.org/show_bug.cgi?id=78706 13 * All String HTML methods should be LOWER case - 14 */ 15 //----------------------------------------------------------------------------- 16 var UBound = 0; 17 var BUGNUMBER = 76054; 18 var summary = 'Testing that String HTML methods produce all lower-case'; 19 var statprefix = 'Currently testing String.'; 20 var status = ''; 21 var statusitems = [ ]; 22 var actual = ''; 23 var actualvalues = [ ]; 24 var expect= ''; 25 var expectedvalues = [ ]; 26 var s = 'xyz'; 27 28 status = 'anchor()'; 29 actual = s.anchor(); 30 expect = actual.toLowerCase(); 31 addThis(); 32 33 status = 'big()'; 34 actual = s.big(); 35 expect = actual.toLowerCase(); 36 addThis(); 37 38 status = 'blink()'; 39 actual = s.blink(); 40 expect = actual.toLowerCase(); 41 addThis(); 42 43 status = 'bold()'; 44 actual = s.bold(); 45 expect = actual.toLowerCase(); 46 addThis(); 47 48 status = 'italics()'; 49 actual = s.italics(); 50 expect = actual.toLowerCase(); 51 addThis(); 52 53 status = 'fixed()'; 54 actual = s.fixed(); 55 expect = actual.toLowerCase(); 56 addThis(); 57 58 status = 'fontcolor()'; 59 actual = s.fontcolor(); 60 expect = actual.toLowerCase(); 61 addThis(); 62 63 status = 'fontsize()'; 64 actual = s.fontsize(); 65 expect = actual.toLowerCase(); 66 addThis(); 67 68 status = 'link()'; 69 actual = s.link(); 70 expect = actual.toLowerCase(); 71 addThis(); 72 73 status = 'small()'; 74 actual = s.small(); 75 expect = actual.toLowerCase(); 76 addThis(); 77 78 status = 'strike()'; 79 actual = s.strike(); 80 expect = actual.toLowerCase(); 81 addThis(); 82 83 status = 'sub()'; 84 actual = s.sub(); 85 expect = actual.toLowerCase(); 86 addThis(); 87 88 status = 'sup()'; 89 actual = s.sup(); 90 expect = actual.toLowerCase(); 91 addThis(); 92 93 94 //------------------------------------------------------------------------------------------------- 95 test(); 96 //------------------------------------------------------------------------------------------------- 97 98 99 function addThis() 100 { 101 statusitems[UBound] = status; 102 actualvalues[UBound] = actual; 103 expectedvalues[UBound] = expect; 104 UBound++; 105 } 106 107 108 function test() 109 { 110 printBugNumber(BUGNUMBER); 111 printStatus (summary); 112 113 for (var i = 0; i < UBound; i++) 114 { 115 reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); 116 } 117 } 118 119 120 function getStatus(i) 121 { 122 return statprefix + statusitems[i]; 123 }