| <html> |
| <head> |
| <script src="../http/tests/inspector/inspector-test.js"></script> |
| <script src="syntax-highlight.js"></script> |
| <script> |
| |
| function test() |
| { |
| function dumpSyntaxHighlightJS(str) |
| { |
| InspectorTest.dumpSyntaxHighlight(str, "text/javascript"); |
| } |
| |
| dumpSyntaxHighlightJS("return'foo';"); |
| dumpSyntaxHighlightJS("/\\\//g"); |
| dumpSyntaxHighlightJS("//ig';"); |
| dumpSyntaxHighlightJS("1 / 2 + /a/.test('a');"); |
| dumpSyntaxHighlightJS("\"\\\"/\".length / 2"); |
| dumpSyntaxHighlightJS("var foo = 1/*/***//2"); |
| dumpSyntaxHighlightJS("/*comment*//.*/.test('a')"); |
| dumpSyntaxHighlightJS("'f\\\noo';"); |
| dumpSyntaxHighlightJS("'\\f\\b\\t';"); |
| dumpSyntaxHighlightJS("'/\\\n/';"); |
| dumpSyntaxHighlightJS("foo/**\n/\n*/foo"); |
| dumpSyntaxHighlightJS("{0: true}"); |
| dumpSyntaxHighlightJS("var toString;"); |
| dumpSyntaxHighlightJS("var foo = undefined;"); |
| dumpSyntaxHighlightJS("var foo = Infinity;"); |
| dumpSyntaxHighlightJS("var foo = NaN;"); |
| |
| InspectorTest.completeTest(); |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| Tests that JavaScriptSourceSyntaxHighlighter detects the tokens. |
| </p> |
| |
| </body> |
| </html> |