aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/huge-number-of-comments.js
blob: 3b90bc0e0834bcf7491d78298936b7138c15a0c2 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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, {
            fromString: true,
            mangle: false,
            compress: {}
        });
        assert.strictEqual(result.code, "function lots_of_comments(x){return 7-x}");
    });
});