mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
fix: game files keep the full game name instead of cutting it at 40 characters (#1230)
This commit is contained in:
1 parent
25938cc249
commit
705da08a0e
2 files changed
+27
-2
No files matched your search
@@ -132,6 +132,23 @@ class GameFilesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun longTitlesKeepTheirEndingAndStayApart() {
|
||||
val folder = tmp.newFolder()
|
||||
val first = game("32370", "STAR WARS™ Knights of the Old Republic™")
|
||||
val second = game("208580", "STAR WARS™ Knights of the Old Republic™ II - The Sith Lords™")
|
||||
assertEquals("STAR WARS™ Knights of the Old Republic™ II - The Sith Lords™.steam", GameFiles.filename(second))
|
||||
GameFiles.sync(app, folder, listOf(first, second))
|
||||
GameFiles.sync(app, folder, listOf(first, second))
|
||||
assertEquals("32370", File(folder, "STAR WARS™ Knights of the Old Republic™.steam").readText())
|
||||
assertEquals("208580", File(folder, "STAR WARS™ Knights of the Old Republic™ II - The Sith Lords™.steam").readText())
|
||||
assertEquals(2, folder.listFiles()!!.count { it.extension == GameFiles.EXTENSION })
|
||||
assertEquals("a".repeat(200) + ".steam", GameFiles.filename(game(name = "a".repeat(300))))
|
||||
assertEquals("a".repeat(199) + ".steam", GameFiles.filename(game(name = "a".repeat(199) + " b")))
|
||||
assertEquals("Game.steam", GameFiles.filename(game(name = " . ")))
|
||||
assertEquals("Game.steam", GameFiles.filename(game(name = "Game . .")))
|
||||
assertEquals("a".repeat(197) + ".steam", GameFiles.filename(game(name = "a".repeat(197) + " . b")))
|
||||
}
|
||||
|
||||
@Test fun refusesSymlinksLeavingTheExportFolder() {
|
||||
val folder = tmp.newFolder()
|
||||
val outside = tmp.newFile()
|
||||
|
||||
Reference in new issue
Block a user