DesktopLaunchLinkTest.kt
composeApp/src/desktopTest/kotlin/eu/friedcutlet/yokan/app/DesktopLaunchLinkTest.kt
1package eu.friedcutlet.yokan.app23import eu.friedcutlet.yokan.ui.navigation.searchDeepLink4import java.io.File5import kotlin.test.Test6import kotlin.test.assertEquals7import kotlin.test.assertNull89class DesktopLaunchLinkTest {10 @Test11 fun mapsSearchFlagsLinksAndBackupFiles() {12 assertEquals(searchDeepLink("One Piece"), desktopLaunchLink(arrayOf("--tray", "--search", "One Piece")))13 assertEquals(searchDeepLink("Berserk"), desktopLaunchLink(arrayOf("--search=Berserk")))14 assertEquals("mihon://add-repo?url=x", desktopLaunchLink(arrayOf("--tray", "mihon://add-repo?url=x")))1516 val backup = File.createTempFile("library", ".tachibk").apply { deleteOnExit() }17 assertEquals(backup.absoluteFile.toURI().toString(), desktopLaunchLink(arrayOf(backup.path)))1819 assertNull(desktopLaunchLink(arrayOf("--tray", "missing.tachibk")))20 assertNull(desktopLaunchLink(arrayOf("--search")))21 }22}23