(realpath, realpathSync, callback)
| 188 | } |
| 189 | |
| 190 | function test_deep_relative_dir_symlink(realpath, realpathSync, callback) { |
| 191 | console.log('test_deep_relative_dir_symlink'); |
| 192 | if (skipSymlinks) { |
| 193 | common.printSkipMessage('symlink test (no privs)'); |
| 194 | return callback(); |
| 195 | } |
| 196 | const expected = fixtures.path('cycles', 'folder'); |
| 197 | const path1b = path.join(targetsAbsDir, 'nested-index', 'one'); |
| 198 | const linkPath1b = path.join(path1b, 'symlink1-dir'); |
| 199 | const linkData1b = path.relative(path1b, expected); |
| 200 | try { fs.unlinkSync(linkPath1b); } catch { |
| 201 | // Continue regardless of error. |
| 202 | } |
| 203 | fs.symlinkSync(linkData1b, linkPath1b, 'dir'); |
| 204 | |
| 205 | const linkData2b = '../one/symlink1-dir'; |
| 206 | const entry = path.join(targetsAbsDir, |
| 207 | 'nested-index', 'two', 'symlink12-dir'); |
| 208 | try { fs.unlinkSync(entry); } catch { |
| 209 | // Continue regardless of error. |
| 210 | } |
| 211 | fs.symlinkSync(linkData2b, entry, 'dir'); |
| 212 | unlink.push(linkPath1b); |
| 213 | unlink.push(entry); |
| 214 | |
| 215 | assertEqualPath(realpathSync(entry), path.resolve(expected)); |
| 216 | |
| 217 | asynctest(realpath, [entry], callback, function(err, result) { |
| 218 | assertEqualPath(result, path.resolve(expected)); |
| 219 | }); |
| 220 | } |
| 221 | |
| 222 | function test_cyclic_link_protection(realpath, realpathSync, callback) { |
| 223 | console.log('test_cyclic_link_protection'); |
nothing calls this directly
no test coverage detected