mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
test: named pipe is invalid when appending .txt
On Windows, appending '.txt' to a named pipe does not produce a valid
regular file name. We want an empty _file_, not an invalid named pipe.
Fix-up for commit 1f79e4f.
PR-URL: https://github.com/node-forward/node/pull/63
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
1 parent
fcbbc7a050
commit
b594e59543
1 file changed
+13
-1
@@ -31,7 +31,19 @@ var accessErrorFired = false;
|
||||
|
||||
// Test if ENOTSOCK is fired when trying to connect to a file which is not
|
||||
// a socket.
|
||||
var emptyTxt = common.PIPE + '.txt';
|
||||
|
||||
var emptyTxt;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// on Win, common.PIPE will be a named pipe, so we use an existing empty
|
||||
// file instead
|
||||
emptyTxt = path.join(common.fixturesDir, 'empty.txt');
|
||||
} else {
|
||||
// use common.PIPE to ensure we stay within POSIX socket path length
|
||||
// restrictions, even on CI
|
||||
emptyTxt = common.PIPE + '.txt';
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
try {
|
||||
fs.unlinkSync(emptyTxt);
|
||||
|
||||
Reference in new issue
Block a user