PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/syntaxhighlighter_3.0.83/tests/commonjs_tests.js

#
JavaScript | 52 lines | 43 code | 6 blank | 3 comment | 2 complexity | 9e8e4927932c36b73ddc6d568bfc38d8 MD5 | raw file
 1/**
 2 * This is a CommonJS compatibility test. You can run this file with node.
 3 */
 4require.paths.unshift(__dirname + '/../scripts');
 5
 6var 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
38brushes.sort();
39
40for (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}