Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test: add extra checks in simple/test-cli-eval
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Sep 4, 2012
1 parent 83b1dda commit 19a4322
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/simple/test-cli-eval.js
Expand Up @@ -39,11 +39,13 @@ var filename = __filename.replace(/\\/g, '/');
child.exec(nodejs + ' --eval 42',
function(err, stdout, stderr) {
assert.equal(stdout, '');
assert.equal(stderr, '');
});

// 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');
});

Expand All @@ -54,11 +56,13 @@ child.exec(nodejs + ' --eval "console.error(42)"',
child.exec(cmd + '42',
function(err, stdout, stderr) {
assert.equal(stdout, '42\n');
assert.equal(stderr, '');
});

child.exec(cmd + "'[]'",
function(err, stdout, stderr) {
assert.equal(stdout, '[]\n');
assert.equal(stderr, '');
});
});

Expand All @@ -84,4 +88,5 @@ child.exec(nodejs + ' -e ""', function(status, stdout, stderr) {
child.exec(nodejs + ' -p "\\-42"',
function(err, stdout, stderr) {
assert.equal(stdout, '-42\n');
assert.equal(stderr, '');
});

0 comments on commit 19a4322

Please sign in to comment.