Fix fs.realpathSync('/')
This commit is contained in:
parent
85fb47c11c
commit
3a9570386a
@ -519,8 +519,10 @@ function realpathSync (p) {
|
|||||||
i = 0;
|
i = 0;
|
||||||
buf = [''];
|
buf = [''];
|
||||||
}
|
}
|
||||||
return buf.join('/');
|
return buf.join('/') || '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function realpath (p, cb) {
|
function realpath (p, cb) {
|
||||||
if (p.charAt(0) !== '/') {
|
if (p.charAt(0) !== '/') {
|
||||||
p = path.join(process.cwd(), p);
|
p = path.join(process.cwd(), p);
|
||||||
|
@ -260,6 +260,15 @@ function runNextTest(err) {
|
|||||||
}
|
}
|
||||||
runNextTest();
|
runNextTest();
|
||||||
|
|
||||||
|
|
||||||
|
assert.equal('/', fs.realpathSync('/'));
|
||||||
|
fs.realpath('/', function (err, result) {
|
||||||
|
assert.equal(null, err);
|
||||||
|
assert.equal('/', result);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
process.addListener("exit", function () {
|
process.addListener("exit", function () {
|
||||||
unlink.forEach(function(path){ try {fs.unlinkSync(path);}catch(e){} });
|
unlink.forEach(function(path){ try {fs.unlinkSync(path);}catch(e){} });
|
||||||
assert.equal(async_completed, async_expected);
|
assert.equal(async_completed, async_expected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user