mirror of
https://github.com/nodejs/node.git
synced 2024-11-28 22:46:31 +01:00
3e1b1dd4a9
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
28 lines
583 B
JavaScript
28 lines
583 B
JavaScript
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var TTY = process.binding('tty_wrap').TTY;
|
|
var isTTY = process.binding('tty_wrap').isTTY;
|
|
|
|
if (isTTY(1) == false) {
|
|
console.error('fd 1 is not a tty. skipping test.');
|
|
process.exit(0);
|
|
}
|
|
|
|
var handle = new TTY(1);
|
|
var callbacks = 0;
|
|
|
|
var req1 = handle.writeBuffer(Buffer('hello world\n'));
|
|
req1.oncomplete = function() {
|
|
callbacks++;
|
|
};
|
|
|
|
var req2 = handle.writeBuffer(Buffer('hello world\n'));
|
|
req2.oncomplete = function() {
|
|
callbacks++;
|
|
};
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(2, callbacks);
|
|
});
|