|
1 // Binary: cache/js-dbg-32-17af008937e3-linux |
|
2 // Flags: -m -n -a |
|
3 // |
|
4 var lfcode = new Array(); |
|
5 lfcode.push("\ |
|
6 var gTestcases = new Array();\ |
|
7 var gTc = gTestcases.length;\ |
|
8 function TestCase(n, d, e, a) {\ |
|
9 this.passed = getTestCaseResult(e, a);\ |
|
10 this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';\ |
|
11 gTestcases[gTc++] = this;\ |
|
12 }\ |
|
13 for (var i=0; i<len; i++) {}\ |
|
14 function reportCompare (expected, actual, description) {\ |
|
15 var testcase = new TestCase(\"unknown-test-name\", description, expected, actual);\ |
|
16 if (testcase.passed)\ |
|
17 printStatus (\"Expected match to '\" + toPrinted(expectedRegExp) + \"' matched actual value '\" + toPrinted(actual) + \"'\");\ |
|
18 }\ |
|
19 function getTestCaseResult(expected, actual)\ |
|
20 function stopTest() {}\ |
|
21 "); |
|
22 lfcode.push("\ |
|
23 var UBound = 0;\ |
|
24 var TEST_PASSED = 'SyntaxError';\ |
|
25 var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';\ |
|
26 var statusitems = [];\ |
|
27 var actualvalues = [];\ |
|
28 var expectedvalues = [];\ |
|
29 testThis(' /a**/ ');\ |
|
30 testThis(' /a***/ ');\ |
|
31 testThis(' /a++/ ');\ |
|
32 testThis(' /a+++/ ');\ |
|
33 testThis(' /a???/ ');\ |
|
34 testThis(' /a????/ ');\ |
|
35 testThis(' /+a/ ');\ |
|
36 testThis(' /++a/ ');\ |
|
37 testThis(' /?a/ ');\ |
|
38 testThis(' /??a/ ');\ |
|
39 testThis(' /x{1}{1}/ ');\ |
|
40 testThis(' /x{1,}{1}/ ');\ |
|
41 testThis(' /x{1,2}{1}/ ');\ |
|
42 testThis(' /x{1}{1,}/ ');\ |
|
43 testThis(' /x{1,}{1,}/ ');\ |
|
44 testThis(' /x{1,2}{1,}/ ');\ |
|
45 testThis(' /x{1}{1,2}/ ');\ |
|
46 testThis(' /x{1,}{1,2}/ ');\ |
|
47 function testThis(sInvalidSyntax) {\ |
|
48 try {\ |
|
49 eval(sInvalidSyntax);\ |
|
50 } catch(e) {\ |
|
51 actual = TEST_PASSED;\ |
|
52 }\ |
|
53 }\ |
|
54 function checkThis(sAllowedSyntax) {}\ |
|
55 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);\ |
|
56 exitFunc ('test');\ |
|
57 "); |
|
58 lfcode.push("gczeal(4);"); |
|
59 lfcode.push("\ |
|
60 var MSG_PATTERN = '\\nregexp = ';\ |
|
61 var MSG_STRING = '\\nstring = ';\ |
|
62 var MSG_EXPECT = '\\nExpect: ';\ |
|
63 var MSG_ACTUAL = '\\nActual: ';\ |
|
64 var TYPE_STRING = typeof 'abc';\ |
|
65 function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches)\ |
|
66 lExpect = expectedmatch.length;\ |
|
67 lActual = actualmatch.length;\ |
|
68 var expected = formatArray(expectedmatch);\ |
|
69 reportCompare(expected, actual, state + ERR_MATCH + CHAR_NL );\ |
|
70 function getState(status, pattern, string) {\ |
|
71 var delim = CHAR_COMMA + CHAR_SPACE;\ |
|
72 "); |
|
73 lfcode.push("\ |
|
74 var gTestcases = new Array;\ |
|
75 function TestCase(n, d, e, a) {}\ |
|
76 function toPrinted(value) value=value.replace(/\\\\n/g, 'NL').replace(/[^\\x20-\\x7E]+/g, escapeString);\ |
|
77 "); |
|
78 lfcode.push("\ |
|
79 var summary = 'Regression test for bug 385393';\ |
|
80 var expect = 'No Crash';\ |
|
81 reportCompare(expect, actual, summary);\ |
|
82 "); |
|
83 while (true) { |
|
84 var file = lfcode.shift(); if (file == undefined) { break; } |
|
85 loadFile(file); |
|
86 } |
|
87 function loadFile(lfVarx) { |
|
88 try { |
|
89 if (lfVarx.substr(-3) == ".js") { |
|
90 switch (lfRunTypeId) { } |
|
91 } else { |
|
92 evaluate(lfVarx); |
|
93 } |
|
94 } catch (lfVare) { } |
|
95 } |