From 4cb37b590e417f94c70f8a55e14a7b513a4cff4b Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Wed, 29 Mar 2017 17:32:46 +0800 Subject: [PATCH] add tests --- test/compress/issue-597.js | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/compress/issue-597.js b/test/compress/issue-597.js index e926c292..3a501532 100644 --- a/test/compress/issue-597.js +++ b/test/compress/issue-597.js @@ -63,3 +63,47 @@ beautify_off_2: { } expect_exact: "console.log(null.toString(),(void 0).toString());" } + +beautify_on_1: { + options = { + evaluate: true, + } + beautify = { + beautify: true, + } + input: { + var NaN; + console.log( + null, + undefined, + Infinity, + NaN, + Infinity * undefined, + Infinity.toString(), + NaN.toString(), + (Infinity * undefined).toString() + ); + } + expect_exact: [ + "var NaN;", + "", + "console.log(null, void 0, 1 / 0, NaN, 0 / 0, (1 / 0).toString(), NaN.toString(), (0 / 0).toString());", + ] + expect_stdout: true +} + +beautify_on_2: { + options = { + evaluate: true, + } + beautify = { + beautify: true, + } + input: { + console.log( + null.toString(), + undefined.toString() + ); + } + expect_exact: "console.log(null.toString(), (void 0).toString());" +}