From 31fb10f393fbfd4d7adf528ec70624d2b8d247a8 Mon Sep 17 00:00:00 2001 From: JinweiClarkChao Date: Thu, 20 Feb 2014 12:50:15 +0800 Subject: Six Blocks Version --- Blocks/syntax/tests/commonjs_tests.js | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Blocks/syntax/tests/commonjs_tests.js (limited to 'Blocks/syntax/tests/commonjs_tests.js') diff --git a/Blocks/syntax/tests/commonjs_tests.js b/Blocks/syntax/tests/commonjs_tests.js new file mode 100644 index 0000000..cda8162 --- /dev/null +++ b/Blocks/syntax/tests/commonjs_tests.js @@ -0,0 +1,52 @@ +/** + * This is a CommonJS compatibility test. You can run this file with node. + */ +require.paths.unshift(__dirname + '/../scripts'); + +var sys = require('sys'), + shSyntaxHighlighter = require('shCore').SyntaxHighlighter, + code = 'test', + brushes = [ + 'AS3', + 'AppleScript', + 'Bash', + 'CSharp', + 'ColdFusion', + 'Cpp', + 'Css', + 'Delphi', + 'Diff', + 'Erlang', + 'Groovy', + 'JScript', + 'Java', + 'JavaFX', + 'Perl', + 'Php', + 'Plain', + 'PowerShell', + 'Python', + 'Ruby', + 'Sass', + 'Scala', + 'Sql', + 'Vb', + 'Xml' + ] + ; + +brushes.sort(); + +for (var i = 0; i < brushes.length; i++) +{ + var name = brushes[i], + brush = require('shBrush' + name).Brush + ; + + brush = new brush(); + brush.init({ toolbar: false }); + + var result = brush.getHtml(code); + + sys.puts(name + (result != null ? ': ok' : ': NOT OK')); +} -- cgit v1.2.3