Fix up test(s)

This commit is contained in:
2025-03-18 21:25:14 +01:00
parent a6cfd3e16e
commit 1dabc804b4
3 changed files with 35 additions and 29 deletions

View File

@@ -707,7 +707,6 @@ void main() {
};
list.enableAll();
final order = list.generateLoadOrder();
final expected = [
'zetrith.prepatcher',
'brrainz.harmony',
@@ -717,6 +716,28 @@ void main() {
'ludeon.rimworld.biotech',
'ludeon.rimworld.ideology',
'ludeon.rimworld.royalty',
'rah.rbse',
'mlie.usethisinstead',
'dubwise.rimatomics',
'jecrell.doorsexpanded',
'balistafreak.stopdropandroll',
'fluffy.animaltab',
'gt.sam.glittertech',
'dubwise.rimefeller',
'darthcy.misc.morebetterdeepdrill',
'haplo.miscellaneous.training',
'linkolas.stabilize',
'dubwise.dubsperformanceanalyzer.steam',
'memegoddess.searchanddestroy',
'gogatio.mechanoidupgrades',
'issaczhuang.muzzleflash',
'smashphil.vehicleframework',
'cabbage.rimcities',
'vis.staticquality',
'automatic.bionicicons',
'vanillaexpanded.vanillatraitsexpanded',
'tk421storm.ragdoll',
'andromeda.nicehealthtab',
];
expect(order.loadOrder, equals(expected));
});

View File

@@ -782,10 +782,7 @@ void main() {
expect(result.loadOrder.contains('existingMod'), isTrue);
// The existing loadAfter relationship should be honored
expect(
result.loadOrder.indexOf('existingMod'),
lessThan(result.loadOrder.indexOf('modA')),
);
expect(result.loadOrder, equals(expected));
// System should track or report the missing loadAfter targets
expect(result.errors, isEmpty); // Soft constraints shouldn't cause errors
@@ -822,8 +819,7 @@ void main() {
isFalse,
);
// Mod should still be , equals(expected)pendencies
expect(result.loadOrder.contains('modA'), isTrue);
expect(result.loadOrder, equals(expected));
},
);

View File

@@ -691,52 +691,41 @@ void main() {
test('Should not fuck up troubleshooter', () {
final troubleshooter = ModListTroubleshooter(modList);
final expectedFirst = [
'test.mod1',
// 0 depends on 1
'test.mod0',
'test.mod10',
'test.mod9',
'test.mod8',
'test.mod2',
// 3 depends on 4
'test.mod4',
'test.mod3',
'test.mod5',
// 6 depends on 7
'test.mod7',
'test.mod6',
'test.mod8',
// 9 depends on 10
'test.mod10',
'test.mod9',
'test.mod1',
'test.mod0',
];
var result = troubleshooter.linearForward(stepSize: 10);
var loadOrder = result.loadRequired();
expect(loadOrder.loadOrder.length, equals(11));
for (int i = 0; i < expectedFirst.length; i++) {
expect(loadOrder.loadOrder[i], equals(expectedFirst[i]));
}
expect(loadOrder.loadOrder, equals(expectedFirst));
final expectedSecond = [
'test.mod10',
'test.mod19',
'test.mod18',
'test.mod17',
'test.mod11',
// 12 depends on 13
'test.mod13',
'test.mod12',
'test.mod14',
// 15 depends on 16
'test.mod16',
'test.mod15',
'test.mod17',
// 18 depends on 19
'test.mod19',
'test.mod18',
'test.mod10',
];
result = troubleshooter.linearForward(stepSize: 10);
loadOrder = result.loadRequired();
expect(loadOrder.loadOrder.length, equals(10));
for (int i = 0; i < expectedSecond.length; i++) {
expect(loadOrder.loadOrder[i], equals(expectedSecond[i]));
}
expect(loadOrder.loadOrder, equals(expectedSecond));
});
});
}