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

@@ -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));
});
});
}