From: XhmikosR Date: Mon, 18 Mar 2013 18:09:33 +0000 (+0200) Subject: test: style consistency changes and simplify quotes X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0be9061cc9b323e38e0529b3dc6c942738f9cf95;p=clean-css.git test: style consistency changes and simplify quotes --- diff --git a/test/batch-test.js b/test/batch-test.js index 7e0de08e..98177e27 100644 --- a/test/batch-test.js +++ b/test/batch-test.js @@ -10,7 +10,8 @@ var batchContexts = function() { var context = {}; var dir = path.join(__dirname, 'data'); fs.readdirSync(dir).forEach(function(filename) { - if (/min.css$/.exec(filename) || !fs.statSync(path.join(dir, filename)).isFile()) return; + if (/min.css$/.exec(filename) || !fs.statSync(path.join(dir, filename)).isFile()) + return; var testName = filename.split('.')[0]; context[testName] = { diff --git a/test/bench.js b/test/bench.js index e6bf0593..196aaec4 100644 --- a/test/bench.js +++ b/test/bench.js @@ -2,7 +2,7 @@ var cleanCSS = require('../index'), bigcss = require('fs').readFileSync(require('path').join(__dirname, 'data', 'big.css'), 'utf8'); if (!process.hrtime) { - console.log("process.hrtime() (node > 0.7.6) is required for benchmarking"); + console.log('process.hrtime() (node.js > 0.7.6) is required for benchmarking'); process.exit(1); } @@ -10,4 +10,4 @@ var start = process.hrtime(); cleanCSS.process(bigcss, { debug: true }); var itTook = process.hrtime(start); -console.log('complete minification: %d ms', 1000 * itTook[0] + itTook[1] / 1000000.0); \ No newline at end of file +console.log('complete minification: %d ms', 1000 * itTook[0] + itTook[1] / 1000000.0); diff --git a/test/binary-test.js b/test/binary-test.js index 7b13e62d..fd43103b 100644 --- a/test/binary-test.js +++ b/test/binary-test.js @@ -12,7 +12,7 @@ var binaryContext = function(options, context) { context.topic = function() { // We add __DIRECT__=1 to force binary into 'non-piped' mode - exec("__DIRECT__=1 ./bin/cleancss " + options, this.callback); + exec('__DIRECT__=1 ./bin/cleancss ' + options, this.callback); }; return context; }; @@ -22,7 +22,7 @@ var pipedContext = function(css, options, context) { return {}; context.topic = function() { - exec("echo \"" + css + "\" | ./bin/cleancss " + options, this.callback); + exec('echo "' + css + '" | ./bin/cleancss ' + options, this.callback); }; return context; }; @@ -94,7 +94,7 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ assert.equal(stdout, minimized); } }), - 'to file': binaryContext('-o reset-min.css ./test/data/reset.css', { + 'to file': binaryContext('-o ./reset-min.css ./test/data/reset.css', { 'should give no output': function(error, stdout) { assert.equal(stdout, ''); }, @@ -105,9 +105,9 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ }, teardown: function() { if (isWindows) - exec('del /q /f reset-min.css'); + exec('del /q /f ./reset-min.css'); else - exec('rm reset-min.css'); + exec('rm ./reset-min.css'); } }) -}); \ No newline at end of file +}); diff --git a/test/unit-test.js b/test/unit-test.js index 2baee8c7..06ae154c 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -14,10 +14,10 @@ var cssContext = function(groups, options) { for (var g in groups) { var transformation = groups[g]; - if (typeof transformation == 'string') transformation = [transformation, transformation]; - if (!transformation[0].push) { + if (typeof transformation == 'string') + transformation = [transformation, transformation]; + if (!transformation[0].push) transformation = [[transformation[0], transformation[1]]]; - } for (var i = 0, c = transformation.length; i < c; i++) { context[g + ' #' + (i + 1)] = {