Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 63d8296

Browse filesBrowse files
Fishrock123Myles Borins
authored andcommitted
test: stdin is not always a net.Socket
`<`-ing a file into stdin actually results in a `fs.ReadStream`, rather than a `tty.ReadStream`, and as such does not inherit from net.Socket, unlike the other possible stdin options. Refs: #5916 PR-URL: #5935 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent f60ce10 commit 63d8296
Copy full SHA for 63d8296

File tree

Expand file treeCollapse file tree

1 file changed

+19
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-0
lines changed
Open diff view settings
Collapse file
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict';
2+
// Refs: https://github.com/nodejs/node/pull/5916
3+
4+
const common = require('../common');
5+
const assert = require('assert');
6+
const spawn = require('child_process').spawn;
7+
const net = require('net');
8+
9+
if (process.argv[2] === 'child') {
10+
assert(process.stdin instanceof net.Socket);
11+
return;
12+
}
13+
14+
const proc = spawn(process.execPath, [__filename, 'child'], { stdio: 'ignore' });
15+
// To double-check this test, set stdio to 'pipe' and uncomment the line below.
16+
// proc.stderr.pipe(process.stderr);
17+
proc.on('exit', common.mustCall(function(exitCode) {
18+
process.exitCode = exitCode;
19+
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.