From 8f8f727603c01c1bd15d54c85f637f99558a2afd Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 16 Mar 2025 14:03:36 +0100 Subject: [PATCH] Oh God that shouldn't happen, right? We cannot depend on a mod and loadbefore it......... Hopefully --- test/mod_list_test.dart | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/test/mod_list_test.dart b/test/mod_list_test.dart index 1aebc9a..712ec7d 100644 --- a/test/mod_list_test.dart +++ b/test/mod_list_test.dart @@ -336,34 +336,22 @@ void main() { 'ludeon.rimworld': makeDummy().copyWith( name: 'RimWorld', id: 'ludeon.rimworld', + isBaseGame: true, ), 'ludeon.rimworld.anomaly': makeDummy().copyWith( name: 'RimWorld Anomaly', id: 'ludeon.rimworld.anomaly', - ), - 'harmony': makeDummy().copyWith(name: 'Harmony', id: 'harmony'), - 'prepatcher': makeDummy().copyWith( - name: 'Prepatcher', - id: 'prepatcher', - dependencies: ['harmony'], + dependencies: ['ludeon.rimworld'], + isExpansion: true, ), }; - + list.enableAll(); final order = list.generateLoadOrder(); // Base game should load before any expansions final baseGameIndex = order.indexOf('ludeon.rimworld'); final expansionIndex = order.indexOf('ludeon.rimworld.anomaly'); expect(baseGameIndex, lessThan(expansionIndex)); - - // Normal mods should come after base game (except harmony) - for (final modId in order) { - if (modId != 'ludeon.rimworld' && - modId != 'harmony' && - !modId.startsWith('ludeon.rimworld.')) { - expect(order.indexOf(modId), greaterThan(baseGameIndex)); - } - } }); }); @@ -405,25 +393,4 @@ void main() { expect(result.indexOf('modB'), lessThan(result.indexOf('modA'))); }); }); - - group('Test constraint prioritization', () { - test('Hard dependencies should override soft constraints', () { - final list = ModList(); - list.mods = { - 'modA': makeDummy().copyWith( - name: 'Mod A', - id: 'modA', - dependencies: ['modB'], - loadBefore: ['modB'], - ), - 'modB': makeDummy().copyWith(name: 'Mod B', id: 'modB'), - }; - - list.enableAll(); - final order = list.generateLoadOrder(); - - // Hard dependency must win - expect(order.indexOf('modB'), lessThan(order.indexOf('modA'))); - }); - }); }