From 6c26aaaa8ee3c4b13165dc01d307992647af91dc Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Wed, 11 Nov 2026 19:24:43 +0000 Subject: [PATCH] test(games): verify extractor binds after migrating a saved internal-guest bind --- .../launcher/frontend/GamesFolderMigrationTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/GamesFolderMigrationTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/GamesFolderMigrationTest.kt index 2ce069e0c1..5c2a52e55a 100644 --- a/app/src/test/java/com/droiddeck/launcher/frontend/GamesFolderMigrationTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/frontend/GamesFolderMigrationTest.kt @@ -209,6 +209,13 @@ class GamesFolderMigrationTest { assertEquals(AddedGames.GUEST_DIR + "/PC", binds.getValue(pc.path)) assertTrue(binds.values.none { it == StoreInstallRoot.INTERNAL_GUEST }) assertEquals(binds.getValue(stores.path) + "/One/One.exe", AddedGames.guestPath(app, File(stores, "One/One.exe"))) + val installer = File(stores, "GOG/Game/setup_1.exe").apply { parentFile?.mkdirs(); writeText("MZ") } + val guestInstaller = AddedGames.guestPath(app, installer)!! + val extractorBinds = StoreInstallRoot.guestBinds(app).map { it.substringBeforeLast(':') to it.substringAfterLast(':') } + val covering = extractorBinds.filter { (_, mount) -> guestInstaller.startsWith("$mount/") }.maxByOrNull { it.second.length }!! + assertEquals(installer.canonicalFile, File(covering.first + guestInstaller.removePrefix(covering.second)).canonicalFile) + val internalInstaller = "${StoreInstallRoot.INTERNAL_GUEST}/GOG/Game/setup_1.exe" + assertTrue(extractorBinds.none { (_, mount) -> internalInstaller == mount || internalInstaller.startsWith("$mount/") }) } @Test fun twoFoldersOfOneNameKeepTheirOwnGuestPaths() {