initial commit
[namibia] / public / js / lib / syntaxhighlighter / tests / commonjs_tests.js
1 /**
2  * This is a CommonJS compatibility test. You can run this file with node.
3  */
4 require.paths.unshift(__dirname + '/../scripts');
5
6 var sys = require('sys'),
7         shSyntaxHighlighter = require('shCore').SyntaxHighlighter,
8         code = 'test',
9         brushes = [
10                 'AS3',
11                 'AppleScript',
12                 'Bash',
13                 'CSharp',
14                 'ColdFusion',
15                 'Cpp',
16                 'Css',
17                 'Delphi',
18                 'Diff',
19                 'Erlang',
20                 'Groovy',
21                 'JScript',
22                 'Java',
23                 'JavaFX',
24                 'Perl',
25                 'Php',
26                 'Plain',
27                 'PowerShell',
28                 'Python',
29                 'Ruby',
30                 'Sass',
31                 'Scala',
32                 'Sql',
33                 'Vb',
34                 'Xml'
35         ]
36         ;
37
38 brushes.sort();
39
40 for (var i = 0; i < brushes.length; i++)
41 {
42         var name = brushes[i],
43                 brush = require('shBrush' + name).Brush
44                 ;
45                 
46         brush = new brush();
47         brush.init({ toolbar: false });
48         
49         var result = brush.getHtml(code);
50         
51         sys.puts(name + (result != null ? ': ok' : ': NOT OK'));
52 }