aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/huge-number-of-comments.js
blob: a58f8d0aff248b10ba660d58b992c37bf57669a2 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var Uglify = require('../../');
var assert = require("assert");

describe("Huge number of comments.", function() {
    it("Should parse and compress code with thousands of consecutive comments", function() {
        var js = 'function lots_of_comments(x) { return 7 -';
        var i;
        for (i = 1; i <= 5000; ++i) { js += "// " + i + "\n"; }
        for (; i <= 10000; ++i) { js += "/* " + i + " */ /**/"; }
        js += "x; }";
        var result = Uglify.minify(js, { mangle: false });
        assert.strictEqual(result.code, "function lots_of_comments(x){return 7-x}");
    });
});