mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
fix: keep Steam-installed second-library games out of non-Steam shortcuts
This commit is contained in:
1 parent
1c161a76dd
commit
06caaee343
2 files changed
+48
-1
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import java.io.File
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
|
||||
class AddedGamesTest {
|
||||
@get:Rule val tmp = TemporaryFolder()
|
||||
|
||||
@Test fun steamInstallsInALibraryAreNotScannedAsAddedGames() {
|
||||
val library = tmp.newFolder("card")
|
||||
val common = File(library, "steamapps/common").apply { mkdirs() }
|
||||
File(library, "steamapps/appmanifest_2852190.acf").writeText(
|
||||
"\"AppState\"\n{\n\t\"appid\"\t\t\"2852190\"\n\t\"installdir\"\t\t\"MONSTER_HUNTER_STORIES_3_TWISTED_REFLECTION\"\n}\n",
|
||||
)
|
||||
File(library, "steamapps/appmanifest_17410.acf").writeText(
|
||||
"\"AppState\"\n{\n\t\"appid\"\t\t\"17410\"\n\t\"installdir\"\t\t\"Mirrors Edge\"\n}\n",
|
||||
)
|
||||
assertEquals(setOf("monster_hunter_stories_3_twisted_reflection", "mirrors edge"), AddedGames.steamInstallDirs(common))
|
||||
// Loose game folders at the library root are never Steam's.
|
||||
assertEquals(emptySet<String>(), AddedGames.steamInstallDirs(library))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user