diff --git a/app/src/androidTest/java/dev/lowrespalmtree/comet/UriUtilsTest.kt b/app/src/androidTest/java/dev/lowrespalmtree/comet/UriUtilsTest.kt index cce46a9..fafd6a2 100644 --- a/app/src/androidTest/java/dev/lowrespalmtree/comet/UriUtilsTest.kt +++ b/app/src/androidTest/java/dev/lowrespalmtree/comet/UriUtilsTest.kt @@ -45,39 +45,27 @@ class UriUtilsTest { fun joinUrls() { assertEquals( "gemini://dece.space/some-file.gmi", - dev.lowrespalmtree.comet.utils.joinUrls("gemini://dece.space/", "some-file.gmi") - .toString() + joinUrls("gemini://dece.space/", "some-file.gmi").toString() ) assertEquals( "gemini://dece.space/some-file.gmi", - dev.lowrespalmtree.comet.utils.joinUrls("gemini://dece.space/", "./some-file.gmi") - .toString() + joinUrls("gemini://dece.space/", "./some-file.gmi").toString() ) assertEquals( "gemini://dece.space/some-file.gmi", - dev.lowrespalmtree.comet.utils.joinUrls("gemini://dece.space/dir1", "/some-file.gmi") - .toString() + joinUrls("gemini://dece.space/dir1", "/some-file.gmi").toString() ) assertEquals( "gemini://dece.space/dir1/other-file.gmi", - dev.lowrespalmtree.comet.utils.joinUrls( - "gemini://dece.space/dir1/file.gmi", - "other-file.gmi" - ).toString() + joinUrls("gemini://dece.space/dir1/file.gmi", "other-file.gmi").toString() ) assertEquals( "gemini://dece.space/top-level.gmi", - dev.lowrespalmtree.comet.utils.joinUrls( - "gemini://dece.space/dir1/file.gmi", - "../top-level.gmi" - ).toString() + joinUrls("gemini://dece.space/dir1/file.gmi", "../top-level.gmi").toString() ) assertEquals( "s://hard/test/b/d/a.gmi", - dev.lowrespalmtree.comet.utils.joinUrls( - "s://hard/dir/a", - "./../test/b/c/../d/e/f/../.././a.gmi" - ).toString() + joinUrls("s://hard/dir/a", "./../test/b/c/../d/e/f/../.././a.gmi").toString() ) } @@ -93,28 +81,28 @@ class UriUtilsTest { Pair("mid/content=5/../6", "mid/6"), Pair("../../../../g", "g") ).forEach { (path, expected) -> - assertEquals(expected, dev.lowrespalmtree.comet.utils.removeDotSegments(path)) + assertEquals(expected, removeDotSegments(path)) } } @Test fun removeLastSegment() { - assertEquals("", dev.lowrespalmtree.comet.utils.removeLastSegment("")) - assertEquals("", dev.lowrespalmtree.comet.utils.removeLastSegment("/")) - assertEquals("", dev.lowrespalmtree.comet.utils.removeLastSegment("/a")) - assertEquals("/a", dev.lowrespalmtree.comet.utils.removeLastSegment("/a/")) - assertEquals("/a", dev.lowrespalmtree.comet.utils.removeLastSegment("/a/b")) - assertEquals("/a/b/c", dev.lowrespalmtree.comet.utils.removeLastSegment("/a/b/c/d")) - assertEquals("//", dev.lowrespalmtree.comet.utils.removeLastSegment("///")) + assertEquals("", removeLastSegment("")) + assertEquals("", removeLastSegment("/")) + assertEquals("", removeLastSegment("/a")) + assertEquals("/a", removeLastSegment("/a/")) + assertEquals("/a", removeLastSegment("/a/b")) + assertEquals("/a/b/c", removeLastSegment("/a/b/c/d")) + assertEquals("//", removeLastSegment("///")) } @Test fun popFirstSegment() { - assertEquals(Pair("", ""), dev.lowrespalmtree.comet.utils.popFirstSegment("")) - assertEquals(Pair("a", ""), dev.lowrespalmtree.comet.utils.popFirstSegment("a")) - assertEquals(Pair("/a", ""), dev.lowrespalmtree.comet.utils.popFirstSegment("/a")) - assertEquals(Pair("/a", "/"), dev.lowrespalmtree.comet.utils.popFirstSegment("/a/")) - assertEquals(Pair("/a", "/b"), dev.lowrespalmtree.comet.utils.popFirstSegment("/a/b")) - assertEquals(Pair("a", "/b"), dev.lowrespalmtree.comet.utils.popFirstSegment("a/b")) + assertEquals(Pair("", ""), popFirstSegment("")) + assertEquals(Pair("a", ""), popFirstSegment("a")) + assertEquals(Pair("/a", ""), popFirstSegment("/a")) + assertEquals(Pair("/a", "/"), popFirstSegment("/a/")) + assertEquals(Pair("/a", "/b"), popFirstSegment("/a/b")) + assertEquals(Pair("a", "/b"), popFirstSegment("a/b")) } } \ No newline at end of file