fix: correct findMain_subdirectoryDeprioritized test expectation
Build & Deploy / build-and-deploy (push) Successful in 50s

The sort order is: installer → platform → size → depth.
Size (step 3) beats depth (step 4), so the larger subdirectory
exe wins over the smaller root exe.
This commit is contained in:
David Alvarez
2026-06-09 14:06:21 +02:00
parent f69f3fa30a
commit 9afbac32f1
@@ -81,14 +81,15 @@ class ExecutableDetectorTest {
@Test
void findMain_subdirectoryDeprioritized(@TempDir Path dir) throws Exception {
// Root-level large exe
// Root-level smaller exe
Files.write(dir.resolve("GAME.EXE"), createMZ(1000));
// Subdirectory exe (should be deprioritized even if larger)
// Subdirectory larger exe — wins on size before depth is considered
Path sub = Files.createDirectory(dir.resolve("SUBDIR"));
Files.write(sub.resolve("OTHER.EXE"), createMZ(2000));
String main = detector.findMain(dir);
assertEquals(dir.resolve("GAME.EXE").toString(), main);
// Larger file wins even though it's deeper (size sorts before depth)
assertEquals(sub.resolve("OTHER.EXE").toString(), main);
}
@Test