diff options
author | Evan Lucas <evanlucas@me.com> | 2015-05-19 13:12:26 -0500 |
---|---|---|
committer | Evan Lucas <evanlucas@me.com> | 2015-06-01 08:39:06 -0500 |
commit | c0e7bf2d8ceb65ad3840bc4ebf3cbd9fef8e8c14 (patch) | |
tree | 61e07cfbc404225725fcd25e47158be49bd145c8 /test/sequential | |
parent | d29034b34b97a0c23e93e9d40feae132c622c0fd (diff) | |
download | node-new-c0e7bf2d8ceb65ad3840bc4ebf3cbd9fef8e8c14.tar.gz |
src: add getopt option parser
Options have been moved into the NodeOptions class.
A new global, node_options now exists and is used
to access the options after the command line arguments
have been parsed.
PR-URL: https://github.com/nodejs/io.js/pull/1804
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/sequential')
-rw-r--r-- | test/sequential/test-deprecation-flags.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index e8565a3363..7a5595b06e 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -8,6 +8,7 @@ var node = process.execPath; var normal = [depmod]; var noDep = ['--no-deprecation', depmod]; var traceDep = ['--trace-deprecation', depmod]; +var throwDep = ['--throw-deprecation', depmod]; execFile(node, normal, function(er, stdout, stderr) { console.error('normal: show deprecation warning'); @@ -36,3 +37,13 @@ execFile(node, traceDep, function(er, stdout, stderr) { assert.equal(stack.pop(), '\'This is deprecated\''); console.log('trace ok'); }); + +execFile(node, throwDep, function(er, stdout, stderr) { + console.error('--throw-deprecation: show stack'); + assert.equal(/Error: Command failed/.test(er), true); + assert.equal(stdout, ''); + var stack = stderr.trim().split('\n'); + assert.equal(/util.js:([\d]+)/.test(stack[0]), true); + assert.equal(/throw new Error\(msg\)/.test(stack[1]), true); + console.log('throw ok'); +}); |