[Pkg-javascript-commits] [uglifyjs] 192/228: minor tweaks to `test/ufuzz.js` (#1756)

Jonas Smedegaard dr at jones.dk
Sat Apr 15 14:25:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository uglifyjs.

commit 4a55bb0be50a1faea3a752fdf708765d2419a8c4
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Sun Apr 2 03:17:01 2017 +0800

    minor tweaks to `test/ufuzz.js` (#1756)
    
    - count iterations from `1` instead of `0`
    - remove `unsafe` from default set of `minify()` tests
    - improve usability of help
---
 test/ufuzz.js   | 6 ++++--
 test/ufuzz.json | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/ufuzz.js b/test/ufuzz.js
index 241e043..bd110c3 100644
--- a/test/ufuzz.js
+++ b/test/ufuzz.js
@@ -110,6 +110,8 @@ for (var i = 2; i < process.argv.length; ++i) {
             STMTS_TO_USE = STMTS_TO_USE.filter(function(id){ return id !== omit; })
         });
         break;
+      case '--help':
+      case '-h':
       case '-?':
         console.log('** UglifyJS fuzzer help **');
         console.log('Valid options (optional):');
@@ -128,7 +130,7 @@ for (var i = 2; i < process.argv.length; ++i) {
         return 0;
       default:
         // first arg may be a number.
-        if (i > 2 || !parseInt(process.argv[i], 10)) throw new Error('Unknown argument[' + process.argv[i] + ']; see -? for help');
+        if (i > 2 || !parseInt(process.argv[i], 10)) throw new Error('Unknown argument[' + process.argv[i] + ']; see -h for help');
     }
 }
 
@@ -737,7 +739,7 @@ var minify_options = require("./ufuzz.json").map(function(options) {
 });
 var original_code, original_result;
 var uglify_code, uglify_result, ok;
-for (var round = 0; round < num_iterations; round++) {
+for (var round = 1; round <= num_iterations; round++) {
     process.stdout.write(round + " of " + num_iterations + "\r");
 
     VAR_NAMES.length = INITIAL_NAMES_LEN; // prune any previous names still in the list
diff --git a/test/ufuzz.json b/test/ufuzz.json
index 8db03d2..2d871e8 100644
--- a/test/ufuzz.json
+++ b/test/ufuzz.json
@@ -27,7 +27,6 @@
             "keep_fargs": false,
             "passes": 3,
             "pure_getters": true,
-            "unsafe": true,
             "warnings": false
         }
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list