Introduce pathString/absolute/absolutePathString
Rename invariantSeparatorsPath to invariantSeparatorsPathString to have more consistent names of methods returning path strings. KT-19192
This commit is contained in:
@@ -38,10 +38,10 @@ class PathExtensionsTest : AbstractPathTest() {
|
||||
@Test
|
||||
fun invariantSeparators() {
|
||||
val path = Path("base") / "nested" / "leaf"
|
||||
assertEquals("base/nested/leaf", path.invariantSeparatorsPath)
|
||||
assertEquals("base/nested/leaf", path.invariantSeparatorsPathString)
|
||||
|
||||
val path2 = Path("base", "nested", "leaf")
|
||||
assertEquals("base/nested/leaf", path2.invariantSeparatorsPath)
|
||||
val path2 = Path("base", "nested", "terminal")
|
||||
assertEquals("base/nested/terminal", path2.invariantSeparatorsPathString)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -149,7 +149,7 @@ class PathExtensionsTest : AbstractPathTest() {
|
||||
|
||||
@Test
|
||||
fun copyToNameWithoutParent() {
|
||||
val currentDir = Path("").toAbsolutePath()
|
||||
val currentDir = Path("").absolute()
|
||||
val srcFile = createTempFile().cleanup()
|
||||
val dstFile = createTempFile(directory = currentDir).cleanup()
|
||||
|
||||
@@ -580,4 +580,11 @@ class PathExtensionsTest : AbstractPathTest() {
|
||||
testRelativeTo("foo/bar", "../../foo/bar", "../../sub/../.")
|
||||
testRelativeTo(null, "../../foo/bar", "../../sub/../..")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun absolutePaths() {
|
||||
val relative = Path("./example")
|
||||
assertTrue(relative.absolute().isAbsolute)
|
||||
assertEquals(relative.absolute().pathString, relative.absolutePathString())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user