This commit is contained in:
José Francisco 2016-07-26 00:58:29 +00:00 committed by GitHub
commit 35c8f12179

View File

@ -58,5 +58,14 @@ describe("minify", function() {
assert.strictEqual(result.code, assert.strictEqual(result.code,
'a["foo"]="bar",a.a="red",x={"bar":10};'); 'a["foo"]="bar",a.a="red",x={"bar":10};');
}); });
});
describe('Unary operators', function () {
it('Should preserve a space before increment/decrement', function () {
var js = 'var a = 1 + ++1;var b = 2 - ++1;';
var result = Uglify.minify(js, { fromString: true });
assert.strictEqual(result.code, 'var a=1+ ++1,b=2- ++1;');
});
}); });
}); });