@@ -1244,13 +1244,59 @@ func TestModuleParams_GetUndefinedModulesInOrder(t *testing.T) {
12441244 expected : []string {},
12451245 },
12461246 {
1247- name : "base module covers indexed" ,
1247+ name : "base module defined but indexed module in order is undefined " ,
12481248 params : ModuleParams {
12491249 Order : []string {"topoaa" , "topoaa.1" },
12501250 Topoaa : map [string ]any {
12511251 "param1" : "value1" ,
12521252 },
12531253 },
1254+ expected : []string {"topoaa.1" },
1255+ },
1256+ {
1257+ name : "indexed module defined but base module in order is undefined" ,
1258+ params : ModuleParams {
1259+ Order : []string {"topoaa" , "topoaa.1" },
1260+ Topoaa_1 : map [string ]any {
1261+ "param1" : "value1" ,
1262+ },
1263+ },
1264+ expected : []string {"topoaa" },
1265+ },
1266+ {
1267+ name : "mixed scenario" ,
1268+ params : ModuleParams {
1269+ Order : []string {"topoaa" , "topoaa.1" , "rigidbody.2" , "caprieval" },
1270+ Topoaa : map [string ]any {
1271+ "param1" : "value1" ,
1272+ },
1273+ Topoaa_1 : map [string ]any {
1274+ "param2" : "value2" ,
1275+ },
1276+ Rigidbody_2 : map [string ]any {
1277+ "param3" : "value3" ,
1278+ },
1279+ },
1280+ expected : []string {"caprieval" },
1281+ },
1282+ {
1283+ name : "only base module defined and in order" ,
1284+ params : ModuleParams {
1285+ Order : []string {"topoaa" },
1286+ Topoaa : map [string ]any {
1287+ "param1" : "value1" ,
1288+ },
1289+ },
1290+ expected : []string {},
1291+ },
1292+ {
1293+ name : "only indexed module defined and in order" ,
1294+ params : ModuleParams {
1295+ Order : []string {"topoaa.1" },
1296+ Topoaa_1 : map [string ]any {
1297+ "param1" : "value1" ,
1298+ },
1299+ },
12541300 expected : []string {},
12551301 },
12561302 }
0 commit comments