From ed69adedcd7140fd93d888d6b9dd46a6153adc7f Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 10 Jun 2020 15:51:00 +0100 Subject: fix corner case in `--reduce-test` (#3985) --- test/mocha/reduce.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/mocha/reduce.js') diff --git a/test/mocha/reduce.js b/test/mocha/reduce.js index 271358be..c1864735 100644 --- a/test/mocha/reduce.js +++ b/test/mocha/reduce.js @@ -296,4 +296,18 @@ describe("test/reduce.js", function() { "// }", ]).join("\n")); }); + it("Should handle corner cases when intermediate case differs only in Error.message", function() { + if (semver.satisfies(process.version, "<=0.10")) return; + var result = reduce_test(read("test/input/reduce/diff_error.js"), { + compress: { + keep_fargs: false, + unsafe: true, + }, + mangle: false, + }, { + verbose: false, + }); + if (result.error) throw result.error; + assert.strictEqual(result.code, read("test/input/reduce/diff_error.reduced.js")); + }); }); -- cgit v1.2.3