Move Path.tryCreateSymbolicLinkTo to AbstractPathTest.kt

This commit is contained in:
Abduqodiri Qurbonzoda
2022-08-02 00:48:59 +03:00
committed by Space
parent 81d6fea0c4
commit f0da420b1f
3 changed files with 11 additions and 11 deletions
@@ -28,16 +28,6 @@ class PathTreeWalkTest : AbstractPathTest() {
return basedir
}
fun Path.tryCreateSymbolicLinkTo(original: Path): Path? {
return try {
this.createSymbolicLinkPointingTo(original)
} catch (e: Exception) {
// the underlying OS may not support symbolic links or may require a privilege
println("Creating a symbolic link failed with $e")
null
}
}
fun testVisitedFiles(expected: List<String>, walk: Sequence<Path>, basedir: Path, message: (() -> String)? = null) {
val actual = walk.map { it.relativeToOrSelf(basedir).invariantSeparatorsPathString }
assertEquals(expected.sorted(), actual.toList().sorted(), message?.invoke())