Browse Source

test: add extra checks in simple/test-cli-eval

v0.9.2-release
Ben Noordhuis 12 years ago
parent
commit
19a432260c
  1. 5
      test/simple/test-cli-eval.js

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

@ -39,11 +39,13 @@ var filename = __filename.replace(/\\/g, '/');
child.exec(nodejs + ' --eval 42', child.exec(nodejs + ' --eval 42',
function(err, stdout, stderr) { function(err, stdout, stderr) {
assert.equal(stdout, ''); assert.equal(stdout, '');
assert.equal(stderr, '');
}); });
// assert that "42\n" is written to stderr // assert that "42\n" is written to stderr
child.exec(nodejs + ' --eval "console.error(42)"', child.exec(nodejs + ' --eval "console.error(42)"',
function(err, stdout, stderr) { function(err, stdout, stderr) {
assert.equal(stdout, '');
assert.equal(stderr, '42\n'); assert.equal(stderr, '42\n');
}); });
@ -54,11 +56,13 @@ child.exec(nodejs + ' --eval "console.error(42)"',
child.exec(cmd + '42', child.exec(cmd + '42',
function(err, stdout, stderr) { function(err, stdout, stderr) {
assert.equal(stdout, '42\n'); assert.equal(stdout, '42\n');
assert.equal(stderr, '');
}); });
child.exec(cmd + "'[]'", child.exec(cmd + "'[]'",
function(err, stdout, stderr) { function(err, stdout, stderr) {
assert.equal(stdout, '[]\n'); assert.equal(stdout, '[]\n');
assert.equal(stderr, '');
}); });
}); });
@ -84,4 +88,5 @@ child.exec(nodejs + ' -e ""', function(status, stdout, stderr) {
child.exec(nodejs + ' -p "\\-42"', child.exec(nodejs + ' -p "\\-42"',
function(err, stdout, stderr) { function(err, stdout, stderr) {
assert.equal(stdout, '-42\n'); assert.equal(stdout, '-42\n');
assert.equal(stderr, '');
}); });

Loading…
Cancel
Save