Browse Source

test: fix bad test in test-cli-eval.js

The test checked that stdout was empty. Forgetting to escape brackets
in the argument to --eval made that true on UNIX systems: the error
was written to stderr.

Props to Peter Bright for reporting the issue.
v0.7.4-release
Ben Noordhuis 14 years ago
parent
commit
f9cfd70946
  1. 6
      test/simple/test-cli-eval.js

6
test/simple/test-cli-eval.js

@ -36,10 +36,10 @@ child.exec(nodejs + ' --eval 42',
assert.equal(stdout, '');
});
// assert that nothing is written to stdout
child.exec(nodejs + ' --eval console.log(42)',
// assert that "42\n" is written to stderr
child.exec(nodejs + ' --eval \'console.error(42)\'',
function(err, stdout, stderr) {
assert.equal(stdout, '');
assert.equal(stderr, "42\n");
});
// assert that module loading works

Loading…
Cancel
Save