2011-02-07 James Robinson <jamesr@chromium.org>
[WebKit-https.git] / LayoutTests / sputnik / Conformance / 07_Lexical_Conventions / 7.7_Punctuators / S7.7_A1.html
1 <html>
2 <head>
3 <meta charset='utf-8'>
4 <style>
5 .pass {
6     font-weight: bold;
7     color: green;
8 }
9 .fail {
10     font-weight: bold;
11     color: red;
12 }
13 </style>
14
15 <script>
16 if (window.layoutTestController)
17     layoutTestController.dumpAsText();
18
19 function SputnikError(message)
20 {
21     this.message = message;
22 }
23
24 SputnikError.prototype.toString = function ()
25 {
26     return 'SputnikError: ' + this.message;
27 };
28
29 var sputnikException;
30
31 function testPrint(msg)
32 {
33     var span = document.createElement("span");
34     document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace 
35     span.innerHTML = msg + '<br />';
36 }
37
38 function escapeHTML(text)
39 {
40     return text.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;");
41 }
42
43 function printTestPassed(msg)
44 {
45     testPrint('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
46 }
47
48 function printTestFailed(msg)
49 {
50     testPrint('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
51 }
52
53 function testFailed(msg)
54 {
55     throw new SputnikError(msg);
56 }
57
58 var successfullyParsed = false;
59 </script>
60
61 </head>
62 <body>
63 <p>S7.7_A1</p>
64 <div id='console'></div>
65 <script>
66 try {
67
68 /**
69  * @name: S7.7_A1;
70  * @section: 7.7;
71  * @assertion: Correct interpretation of all punctuators;
72  * @description: Using all punctuators;
73 */
74
75 //CHECK#1
76   ({});[];
77   this.NaN; 
78   1 < 2 > 3 <= 4 >= 5 == 6 != 7 === 8 !== 9;
79   1 + 2 - 3 * 4 % 5 / 6 << 7 >> 8 >>> 9;
80   this.NaN++; ++this.NaN; this.NaN--; --this.NaN;
81   1 & 2 | 3 ^ 4 && !5 || ~6;
82   1 ? 2 : 3;
83   this.NaN = 1; this.NaN += 2; this.NaN -= 3; this.NaN *= 4; this.NaN /= 5;
84   this.NaN %= 6; this.NaN <<= 7; this.NaN >>= 8; this.NaN >>>= 9;
85   this.NaN &= 1; this.NaN |= 2; this.NaN ^= 3;  
86
87 } catch (ex) {
88     sputnikException = ex;
89 }
90
91 var successfullyParsed = true;
92 </script>
93
94 <script>
95 if (!successfullyParsed)
96     printTestFailed('successfullyParsed is not set');
97 else if (sputnikException)
98     printTestFailed(sputnikException);
99 else
100     printTestPassed("");
101 testPrint('<br /><span class="pass">TEST COMPLETE</span>');
102 </script>
103 </body>
104 </html>