diff options
Diffstat (limited to 'test/mocha/cli.js')
-rw-r--r-- | test/mocha/cli.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 85b2e8c9..671d700e 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -650,4 +650,36 @@ describe("bin/uglifyjs", function () { done(); }); }); + it("Should work with explicit --rename", function(done) { + var command = uglifyjscmd + " test/input/rename/input.js --rename"; + exec(command, function(err, stdout, stderr) { + if (err) throw err; + assert.strictEqual(stdout, "function f(a){return b(a);function b(c){return c}}\n"); + done(); + }); + }); + it("Should work with explicit --no-rename", function(done) { + var command = uglifyjscmd + " test/input/rename/input.js -mc --no-rename"; + exec(command, function(err, stdout, stderr) { + if (err) throw err; + assert.strictEqual(stdout, "function f(n){return function(n){return n}(n)}\n"); + done(); + }); + }); + it("Should work with implicit --rename", function(done) { + var command = uglifyjscmd + " test/input/rename/input.js -mc"; + exec(command, function(err, stdout, stderr) { + if (err) throw err; + assert.strictEqual(stdout, "function f(n){return n}\n"); + done(); + }); + }); + it("Should work with implicit --no-rename", function(done) { + var command = uglifyjscmd + " test/input/rename/input.js -c"; + exec(command, function(err, stdout, stderr) { + if (err) throw err; + assert.strictEqual(stdout, "function f(x){return function(x){return x}(x)}\n"); + done(); + }); + }); }); |