mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Mech construction fix and unittest (#12062)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7e9ad48982
commit
ad5a944c8a
@@ -91,6 +91,7 @@
|
||||
#include "autowiki.dm"
|
||||
//#include "clothing_tests.dm" // FIXME
|
||||
#include "component_tests.dm"
|
||||
#include "construction_tests.dm"
|
||||
#include "cosmetic_tests.dm"
|
||||
#include "dcs_check_list_arguments.dm"
|
||||
#include "dcs_get_id_from_elements.dm"
|
||||
|
||||
11
code/modules/unit_tests/construction_tests.dm
Normal file
11
code/modules/unit_tests/construction_tests.dm
Normal file
@@ -0,0 +1,11 @@
|
||||
/datum/unit_test/mech_construction/Run()
|
||||
var/failed = FALSE
|
||||
for(var/datum/construction/C as anything in subtypesof(/datum/construction))
|
||||
// We check for null, as null is legal here... For now... Mech construction needs a full refactor to make them unittest-able in a not ugly way.
|
||||
if(!C.result)
|
||||
continue
|
||||
if(!ispath(C.result))
|
||||
TEST_NOTICE(src, "[C.type]: Mech Construction - Had invalid result \"[C.result]\", must be a path.")
|
||||
failed = TRUE
|
||||
if(failed)
|
||||
TEST_FAIL("Mech Construction - A construction datum had incorrect data.")
|
||||
Reference in New Issue
Block a user