test: replace localhost with os.hostname in fs-readfilesync

PR-URL: https://github.com/nodejs/node/pull/23101
Fixes: https://github.com/nodejs/node/issues/21501
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
This commit is contained in:
Denys Otrishko 2018-09-26 14:00:08 +03:00 committed by Daniel Bevenius
parent a79c88a4ce
commit 1be804d625

View File

@ -11,6 +11,7 @@ if (!common.isWindows)
const assert = require('assert');
const fs = require('fs');
const os = require('os');
const path = require('path');
function test(p) {
@ -23,10 +24,10 @@ function test(p) {
}));
}
test('//localhost/c$/Windows/System32');
test('//localhost/c$/Windows');
test('//localhost/c$/');
test('\\\\localhost\\c$\\');
test(`//${os.hostname()}/c$/Windows/System32`);
test(`//${os.hostname()}/c$/Windows`);
test(`//${os.hostname()}/c$/`);
test(`\\\\${os.hostname()}\\c$\\`);
test('C:\\');
test('C:');
test(process.env.windir);