MCPcopy Index your code
hub / github.com/nodejs/node / test_up_multiple

Function test_up_multiple

test/parallel/test-fs-realpath.js:409–440  ·  view source on GitHub ↗
(realpath, realpathSync, cb)

Source from the content-addressed store, hash-verified

407// `-- d -> ..
408// realpath(a/b/e/d/a/b/e/d/a) ==> a
409function test_up_multiple(realpath, realpathSync, cb) {
410 console.error('test_up_multiple');
411 if (skipSymlinks) {
412 common.printSkipMessage('symlink test (no privs)');
413 return cb();
414 }
415 const tmpdir = require('../common/tmpdir');
416 tmpdir.refresh();
417 fs.mkdirSync(tmp('a'), 0o755);
418 fs.mkdirSync(tmp('a/b'), 0o755);
419 fs.symlinkSync('..', tmp('a/d'), 'dir');
420 unlink.push(tmp('a/d'));
421 fs.symlinkSync('..', tmp('a/b/e'), 'dir');
422 unlink.push(tmp('a/b/e'));
423
424 const abedabed = tmp('abedabed'.split('').join('/'));
425 const abedabed_real = tmp('');
426
427 const abedabeda = tmp('abedabeda'.split('').join('/'));
428 const abedabeda_real = tmp('a');
429
430 assertEqualPath(realpathSync(abedabeda), abedabeda_real);
431 assertEqualPath(realpathSync(abedabed), abedabed_real);
432
433 realpath(abedabeda, common.mustSucceed((real) => {
434 assertEqualPath(abedabeda_real, real);
435 realpath(abedabed, common.mustSucceed((real) => {
436 assertEqualPath(abedabed_real, real);
437 cb();
438 }));
439 }));
440}
441
442
443// Going up with .. multiple times with options = null

Callers

nothing calls this directly

Calls 12

cbFunction · 0.70
tmpFunction · 0.70
realpathFunction · 0.70
requireFunction · 0.50
realpathSyncFunction · 0.50
errorMethod · 0.45
refreshMethod · 0.45
mkdirSyncMethod · 0.45
symlinkSyncMethod · 0.45
pushMethod · 0.45
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…