bug728086.js (1964B)
1 var expected = ''; 2 function TestCase(n, d, e, a) {} 3 function reportFailure (msg) {} 4 function toPrinted(value) { 5 value = value.replace(/\\\n/g, 'NL') 6 .replace(/[^\x20-\x7E]+/g, escapeString); 7 } 8 function escapeString (str) {} 9 function reportCompare (expected, actual, description) { 10 var expected_t = typeof expected; 11 var actual_t = typeof actual; 12 var output = ""; 13 var testcase = new TestCase("unknown-test-name", description, expected, actual); 14 reportFailure (description + " : " + output); 15 } 16 function enterFunc (funcName) { 17 return callStack.push(funcName); 18 } 19 try { 20 reportCompare(expectCompile, actualCompile, 21 summary + ': compile actual'); 22 } catch(ex) { } 23 var lfcode = new Array(); 24 lfcode.push("gczeal(2);\ 25 enterFunc ('test');\ 26 "); 27 lfcode.push("{}"); 28 lfcode.push("noexist.js"); 29 lfcode.push("var BUGNUMBER = 305064;\ 30 var summary = 'Tests the trim, trimRight and trimLeft methods';\ 31 var trimMethods = ['trim', 'trimLeft', 'trimRight'];\ 32 var whitespace = [\ 33 {s : '\\u0009', t : 'HORIZONTAL TAB'},\ 34 {s : '\\u200A', t : 'HAIR SPACE'},\ 35 ];\ 36 for (var j = 0; j < trimMethods.length; ++j)\ 37 var method = trimMethods[j];\ 38 reportCompare(true, true, 'Test skipped. String.prototype.' + method + ' is not supported');\ 39 str = '';\ 40 for (var i = 0; i < whitespace.length; ++i) {\ 41 var v = whitespace[i].s;\ 42 var t = (summary)[i].t;\ 43 v = v + v + v;\ 44 print('Test ' + method + ' with with leading whitespace. : ' + t);\ 45 actual = str[method]();\ 46 reportCompare(expected, actual, t + ':' + '\"' + toPrinted(str) + '\".' + method + '()');\ 47 str = v + 'a' + v;\ 48 }\ 49 "); 50 while (true) { 51 var file = lfcode.shift(); if (file == undefined) { break; } 52 if (file == "evaluate") { 53 } else { 54 loadFile(file); 55 } 56 } 57 function loadFile(lfVarx) { 58 try { 59 if (lfVarx.substr(-3) == ".js") { 60 switch (lfRunTypeId) { 61 } 62 } else { 63 eval(lfVarx); 64 } 65 } catch (lfVare) { } 66 }