From 7fad88bb38d4638ca7f1455afba7b4fc6cc88e52 Mon Sep 17 00:00:00 2001 From: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Date: Mon, 19 Jan 2026 16:51:09 -0500 Subject: [PATCH] Makes a borg rapid construction-type tools unit test (#94864) ## About The Pull Request Makes a unit test that checks the engineering borg's RCD & RTD to make sure they're working. ## Why It's Good For The Game After the issue that happened a little bit ago where these stopped working, a unit test was suggested. This test would have prevented that issue, and also serves as a general rcd and rtd test to some extent. --- code/modules/unit_tests/_unit_tests.dm | 1 + code/modules/unit_tests/borg_tools.dm | 37 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 code/modules/unit_tests/borg_tools.dm diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 076b1a3c31b..93f2059e84e 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -112,6 +112,7 @@ #include "blindness.dm" #include "blood_volume_procs.dm" #include "bloody_footprints.dm" +#include "borg_tools.dm" #include "breath.dm" #include "buckle.dm" #include "burning.dm" diff --git a/code/modules/unit_tests/borg_tools.dm b/code/modules/unit_tests/borg_tools.dm new file mode 100644 index 00000000000..2d4e7393940 --- /dev/null +++ b/code/modules/unit_tests/borg_tools.dm @@ -0,0 +1,37 @@ +/datum/unit_test/borg_tools + priority = TEST_LONGER + var/oldturftype + var/turf/targetturf + +/datum/unit_test/borg_tools/Run() + var/mob/living/silicon/robot/ourborg = EASY_ALLOCATE() + ourborg.model.transform_to(/obj/item/robot_model/engineering, TRUE, FALSE) + targetturf = locate(ourborg.x + 1, ourborg.y, ourborg.z) + oldturftype = targetturf.type + var/obj/item/construction/rtd/borg/rtd = locate(/obj/item/construction/rtd/borg) in ourborg.model + TEST_ASSERT_NOTNULL(rtd, "Engineering borg lacks an RTD module") + targetturf.ChangeTurf(/turf/open/floor/plating) + ourborg.activate_module(rtd) + ourborg.select_module(1) + TEST_ASSERT_NOTNULL(ourborg.module_active, "RTD module failed to activate") + click_wrapper(ourborg, targetturf) + rtd.selected_design.cost = 0.01 + sleep(0.02 SECONDS) + TEST_ASSERT(!isplatingturf(targetturf), "Borg RTD was unable to place floor tiling") + ourborg.deactivate_module(rtd) + + var/obj/item/construction/rcd/borg/rcd = locate(/obj/item/construction/rcd/borg) in ourborg.model + TEST_ASSERT_NOTNULL(rcd, "Engineering borg lacks an RCD module") + rcd.delay_mod = 0.01 + ourborg.activate_module(rcd) + ourborg.select_module(1) + TEST_ASSERT_NOTNULL(ourborg.module_active, "RCD module failed to activate") + click_wrapper(ourborg, targetturf) + sleep(0.02 SECONDS) + TEST_ASSERT(iswallturf(targetturf), "Borg RCD was unable to create wall") + ourborg.deactivate_module(rcd) + +/datum/unit_test/borg_tools/Destroy() + targetturf.ChangeTurf(oldturftype) + return ..() +