From f9cfd709460e04c8417e7784e6e3b264d3ff6c69 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 4 Aug 2011 16:43:11 +0200 Subject: [PATCH] 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. --- test/simple/test-cli-eval.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/simple/test-cli-eval.js b/test/simple/test-cli-eval.js index 6590442aad..bf6271bea4 100644 --- a/test/simple/test-cli-eval.js +++ b/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