From fd267ad1a55e586d35497ba72539c2437036767b Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Fri, 22 Dec 2017 03:47:25 +0800 Subject: [PATCH] add tests --- test/compress/pure_funcs.js | 54 ++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/test/compress/pure_funcs.js b/test/compress/pure_funcs.js index ad7fc861..6f3bbb21 100644 --- a/test/compress/pure_funcs.js +++ b/test/compress/pure_funcs.js @@ -299,19 +299,55 @@ issue_2629_1: { side_effects: true, } input: { - /*@__PURE__*/ f1(); - (/*@__PURE__*/ f2)(); - /*@__PURE__*/ (f3()); - (/*@__PURE__*/ f4()); - /*@__PURE__*/ f5(1)(2)(3); - (/*@__PURE__*/ f6(1)(2)(3)); - /*@__PURE__*/ f7.x(1).y(2).z(3); - (/*@__PURE__*/ f8.x(1).y(2).z(3)); + /*@__PURE__*/ a(); + /*@__PURE__*/ (b()); + (/*@__PURE__*/ c)(); + (/*@__PURE__*/ d()); } expect: {} } issue_2629_2: { + options = { + side_effects: true, + } + input: { + /*@__PURE__*/ a(1)(2)(3); + /*@__PURE__*/ (b(1))(2)(3); + /*@__PURE__*/ (c(1)(2))(3); + /*@__PURE__*/ (d(1)(2)(3)); + (/*@__PURE__*/ e)(1)(2)(3); + (/*@__PURE__*/ f(1))(2)(3); + (/*@__PURE__*/ g(1)(2))(3); + (/*@__PURE__*/ h(1)(2)(3)); + } + expect: {} +} + +issue_2629_3: { + options = { + side_effects: true, + } + input: { + /*@__PURE__*/ a.x(1).y(2).z(3); + /*@__PURE__*/ (a.x)(1).y(2).z(3); + /*@__PURE__*/ (a.x(1)).y(2).z(3); + /*@__PURE__*/ (a.x(1).y)(2).z(3); + /*@__PURE__*/ (a.x(1).y(2)).z(3); + /*@__PURE__*/ (a.x(1).y(2).z)(3); + /*@__PURE__*/ (a.x(1).y(2).z(3)); + (/*@__PURE__*/ a).x(1).y(2).z(3); + (/*@__PURE__*/ a.x)(1).y(2).z(3); + (/*@__PURE__*/ a.x(1)).y(2).z(3); + (/*@__PURE__*/ a.x(1).y)(2).z(3); + (/*@__PURE__*/ a.x(1).y(2)).z(3); + (/*@__PURE__*/ a.x(1).y(2).z)(3); + (/*@__PURE__*/ a.x(1).y(2).z(3)); + } + expect: {} +} + +issue_2629_4: { options = { side_effects: true, } @@ -325,7 +361,7 @@ issue_2629_2: { } } -issue_2629_3: { +issue_2629_5: { options = { side_effects: true, }