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

Function test_simple_absolute_symlink

test/parallel/test-fs-realpath.js:128–154  ·  view source on GitHub ↗
(realpath, realpathSync, callback)

Source from the content-addressed store, hash-verified

126}
127
128function test_simple_absolute_symlink(realpath, realpathSync, callback) {
129 console.log('test_simple_absolute_symlink');
130
131 // This one should still run, even if skipSymlinks is set,
132 // because it uses a junction.
133 const type = skipSymlinks ? 'junction' : 'dir';
134
135 console.log('using type=%s', type);
136
137 const entry = `${tmpAbsDir}/symlink`;
138 const expected = fixtures.path('nested-index', 'one');
139 [
140 [entry, expected],
141 ].forEach(function(t) {
142 try { fs.unlinkSync(t[0]); } catch {
143 // Continue regardless of error.
144 }
145 console.error('fs.symlinkSync(%j, %j, %j)', t[1], t[0], type);
146 fs.symlinkSync(t[1], t[0], type);
147 unlink.push(t[0]);
148 });
149 const result = realpathSync(entry);
150 assertEqualPath(result, path.resolve(expected));
151 asynctest(realpath, [entry], callback, function(err, result) {
152 assertEqualPath(result, path.resolve(expected));
153 });
154}
155
156function test_deep_relative_file_symlink(realpath, realpathSync, callback) {
157 console.log('test_deep_relative_file_symlink');

Callers

nothing calls this directly

Calls 10

asynctestFunction · 0.85
forEachMethod · 0.65
realpathSyncFunction · 0.50
logMethod · 0.45
pathMethod · 0.45
unlinkSyncMethod · 0.45
errorMethod · 0.45
symlinkSyncMethod · 0.45
pushMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…