reduce `ufuzz` test cases that fail to `minify()` (#4021)
authorAlex Lam S.L <alexlamsl@gmail.com>
Tue, 21 Jul 2020 08:17:15 +0000 (09:17 +0100)
committeralexlamsl <alexlamsl@gmail.com>
Tue, 21 Jul 2020 09:22:18 +0000 (17:22 +0800)
test/ufuzz/index.js

index b4059ea..8f853c9 100644 (file)
@@ -1137,18 +1137,6 @@ function log(options) {
         errorln(original_result);
         errorln("uglified result:");
         errorln(uglify_result);
-        errorln("//-------------------------------------------------------------");
-        var reduced = reduce_test(original_code, JSON.parse(options), {
-            verbose: false,
-        }).code;
-        if (reduced) {
-            errorln();
-            errorln("// reduced test case (output will differ)");
-            errorln();
-            errorln(reduced);
-            errorln();
-            errorln("//-------------------------------------------------------------");
-        }
     } else {
         errorln("// !!! uglify failed !!!");
         errorln(uglify_code);
@@ -1159,6 +1147,18 @@ function log(options) {
             errorln(original_result);
         }
     }
+    errorln("//-------------------------------------------------------------");
+    var reduced = reduce_test(original_code, JSON.parse(options), {
+        verbose: false,
+    }).code;
+    if (reduced) {
+        errorln();
+        errorln("// reduced test case (output will differ)");
+        errorln();
+        errorln(reduced);
+        errorln();
+        errorln("//-------------------------------------------------------------");
+    }
     errorln("minify(options):");
     errorln(JSON.stringify(JSON.parse(options), null, 2));
     errorln();