MCPcopy Create free account
hub / github.com/nodejs/node / test_cyclic_link_overprotection

Function test_cyclic_link_overprotection

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

Source from the content-addressed store, hash-verified

249}
250
251function test_cyclic_link_overprotection(realpath, realpathSync, callback) {
252 console.log('test_cyclic_link_overprotection');
253 if (skipSymlinks) {
254 common.printSkipMessage('symlink test (no privs)');
255 return callback();
256 }
257 const cycles = `${tmpDir}/cycles`;
258 const expected = realpathSync(cycles);
259 const folder = `${cycles}/folder`;
260 const link = `${folder}/cycles`;
261 let testPath = cycles;
262 testPath += '/folder/cycles'.repeat(10);
263 try { fs.unlinkSync(link); } catch {
264 // Continue regardless of error.
265 }
266 fs.symlinkSync(cycles, link, 'dir');
267 unlink.push(link);
268 assertEqualPath(realpathSync(testPath), path.resolve(expected));
269 asynctest(realpath, [testPath], callback, function(er, res) {
270 assertEqualPath(res, path.resolve(expected));
271 });
272}
273
274function test_relative_input_cwd(realpath, realpathSync, callback) {
275 console.log('test_relative_input_cwd');

Callers

nothing calls this directly

Calls 8

asynctestFunction · 0.85
callbackFunction · 0.70
realpathSyncFunction · 0.50
logMethod · 0.45
unlinkSyncMethod · 0.45
symlinkSyncMethod · 0.45
pushMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected