add tests for console.log arguments handling
This commit is contained in:
parent
a834d93d2c
commit
bedca2e7a9
17
test/simple/test-console.js
Normal file
17
test/simple/test-console.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
common = require("../common");
|
||||||
|
assert = common.assert;
|
||||||
|
|
||||||
|
var stdout_write = global.process.stdout.write;
|
||||||
|
var strings = [];
|
||||||
|
global.process.stdout.write = function(string) {
|
||||||
|
strings.push(string);
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('foo');
|
||||||
|
console.log('foo', 'bar');
|
||||||
|
console.log('%s %s', 'foo', 'bar', 'hop');
|
||||||
|
|
||||||
|
global.process.stdout.write = stdout_write;
|
||||||
|
assert.equal('foo\n', strings.shift());
|
||||||
|
assert.equal('foo bar\n', strings.shift());
|
||||||
|
assert.equal('foo bar hop\n', strings.shift());
|
Loading…
x
Reference in New Issue
Block a user