forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-tty-wrap hasn’t worked since StreamBase was introduced, I think. test-tty-stdout-end also happens to works with PipeWrap-s. Refs: nodejs#7360 PR-URL: nodejs#7613 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- Loading branch information
1 parent
f3a3888
commit aab3066
Showing
4 changed files
with
10 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,11 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
var assert = require('assert'); | ||
require('../common'); | ||
|
||
var TTY = process.binding('tty_wrap').TTY; | ||
var isTTY = process.binding('tty_wrap').isTTY; | ||
const TTY = process.binding('tty_wrap').TTY; | ||
const WriteWrap = process.binding('stream_wrap').WriteWrap; | ||
|
||
if (isTTY(1) == false) { | ||
common.skip('fd 1 is not a tty.'); | ||
return; | ||
} | ||
const handle = new TTY(1); | ||
const req = new WriteWrap(); | ||
|
||
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); | ||
}); | ||
handle.writeBuffer(req, Buffer.from('hello world 1\n')); | ||
handle.writeBuffer(req, Buffer.from('hello world 2\n')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hello world 1 | ||
hello world 2 |