fix: correct findMain_subdirectoryDeprioritized test expectation
Build & Deploy / build-and-deploy (push) Successful in 50s
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:
@@ -81,14 +81,15 @@ class ExecutableDetectorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void findMain_subdirectoryDeprioritized(@TempDir Path dir) throws Exception {
|
void findMain_subdirectoryDeprioritized(@TempDir Path dir) throws Exception {
|
||||||
// Root-level large exe
|
// Root-level smaller exe
|
||||||
Files.write(dir.resolve("GAME.EXE"), createMZ(1000));
|
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"));
|
Path sub = Files.createDirectory(dir.resolve("SUBDIR"));
|
||||||
Files.write(sub.resolve("OTHER.EXE"), createMZ(2000));
|
Files.write(sub.resolve("OTHER.EXE"), createMZ(2000));
|
||||||
|
|
||||||
String main = detector.findMain(dir);
|
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
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user