Don't crash on non-hierarchical URIs in RepoUriGetter

This commit is contained in:
Torsten Grote committed 2024-02-27 10:39:24 -03:00
1 parent 1b27b711fe
commit 3c2ebe6f49
2 files changed
+19 -3

No files matched your search

@@ -172,6 +172,11 @@ internal class RepoUriGetterTest {
RepoUriGetter.getUri("")
}
@Test
fun testNonHierarchicalUri() {
RepoUriGetter.getUri("mailto:nobody@google.com") // should not crash
}
@Test
fun testSwapUri() {
val uri =
@@ -204,5 +209,8 @@ internal class RepoUriGetterTest {
val uri3 = Uri.parse("http://192.168.3.159:8888/fdroid/repo?BSSID=44:FE:3B:7F:7F:EE")
assertFalse(RepoUriGetter.isSwapUri(uri3))
val uri4 = Uri.parse("mailto:nobody@google.com")
assertFalse(RepoUriGetter.isSwapUri(uri4))
}
}