From 25a5a2257c8a84595fbc503bd846156ec73d6991 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Fri, 16 May 2025 19:40:17 +0100 Subject: [PATCH] Fix test that depends on map strings --- test/integration/clusterio.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/integration/clusterio.js b/test/integration/clusterio.js index e8e715b7..237cfdd2 100644 --- a/test/integration/clusterio.js +++ b/test/integration/clusterio.js @@ -808,17 +808,28 @@ describe("Integration of Clusterio", function() { await execCtl("instance config set 44 statistics_exporter.load_plugin false"); await execCtl("instance config set 44 subspace_storage.load_plugin false"); - let exchangeString = testStrings.modified.replace(/[\n\r]+/g, ""); - let args = `base/freeplay --seed 1234 --map-exchange-string "${exchangeString}"`; + await execCtl("instance start 44"); + const instance = (await getInstances()).get(44); + const isV2 = lib.integerFactorioVersion(instance.factorioVersion) > lib.integerFactorioVersion("2.0.0"); + const exchangeString = (isV2 ? testStrings.modified_v2 : testStrings.modified).replace(/[\n\r]+/g, ""); + const args = `base/freeplay --seed 1234 --map-exchange-string "${exchangeString}"`; + await execCtl("instance stop 44"); + await execCtl(`instance load-scenario test ${args}`); await checkInstanceStatus(44, "running"); await sendRcon(44, '/c game.print("disable achievements")'); await sendRcon(44, '/c game.print("disable achievements")'); assert.equal(await sendRcon(44, "/c rcon.print(game.default_map_gen_settings.seed)"), "1234\n"); assert.equal(await sendRcon(44, "/c rcon.print(game.map_settings.pollution.ageing)"), "1.5\n"); - assert.equal( - await sendRcon(44, "/c rcon.print(game.difficulty_settings.research_queue_setting)"), "never\n" - ); + if (isV2) { + assert.equal( + await sendRcon(44, "/c rcon.print(game.difficulty_settings.spoil_time_modifier)"), "1\n" + ); + } else { + assert.equal( + await sendRcon(44, "/c rcon.print(game.difficulty_settings.research_queue_setting)"), "never\n" + ); + } }); });