diff options
author | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2016-07-08 14:22:14 +0200 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2016-07-11 15:22:09 +0200 |
commit | f3a38883076a3ffc227f062f0b80ff08ed5e79fe (patch) | |
tree | 33ffe42e51c45d52dfde37c8a11238e9d9ebf188 /test/pseudo-tty/test-tty-wrap.js | |
parent | 839f3d971612060ed18a67b051db9e51dfac377f (diff) | |
download | node-new-f3a38883076a3ffc227f062f0b80ff08ed5e79fe.tar.gz |
test: move parallel/test-tty-* to pseudo-tty/
Refs: https://github.com/nodejs/node/pull/7360
PR-URL: https://github.com/nodejs/node/pull/7613
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/pseudo-tty/test-tty-wrap.js')
-rw-r--r-- | test/pseudo-tty/test-tty-wrap.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/pseudo-tty/test-tty-wrap.js b/test/pseudo-tty/test-tty-wrap.js new file mode 100644 index 0000000000..fce4e194a8 --- /dev/null +++ b/test/pseudo-tty/test-tty-wrap.js @@ -0,0 +1,28 @@ +'use strict'; +const 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) { + common.skip('fd 1 is not a tty.'); + return; +} + +var handle = new TTY(1); +var callbacks = 0; + +var req1 = handle.writeBuffer(Buffer.from('hello world\n')); +req1.oncomplete = function() { + callbacks++; +}; + +var req2 = handle.writeBuffer(Buffer.from('hello world\n')); +req2.oncomplete = function() { + callbacks++; +}; + +process.on('exit', function() { + assert.equal(2, callbacks); +}); |