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:
parent
a79c88a4ce
commit
1be804d625
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user