Files
Bubberstation/code/modules/unit_tests/~skyrat/opposing_force.dm
Zonespace 1a84c196bc [MODULAR] OPFOR Expansion - Odds and Ends (#11956)
* standing here on the edge

* the irony of my own unit tests failing on me is not lost

* will this work? god knows

* okay, now that this works

* Update code/modules/unit_tests/_unit_tests.dm

* aye

* weh, fixed

* tired me is not a good coder

* correct this

* max_count + flashbang

* testing a change to the unit test

* weh

* i give up

* Update code/modules/unit_tests/_unit_tests.dm
2022-03-12 18:50:54 +00:00

22 lines
901 B
Plaintext

#define DATUM_PATH_LEN 33
///Checks that all OPFOR items have an `item_type` associated with them
/datum/unit_test/opfor_items
/datum/unit_test/opfor_items/Run()
var/list/subtype_pre = subtypesof(/datum/opposing_force_equipment)
var/list/compiled_subtypes = list()
for(var/datum/opposing_force_equipment/opfor as anything in subtype_pre)
var/path_string = "[opfor]"
var/partially_cut = splicetext(path_string, 1, DATUM_PATH_LEN, "") // now looks like `parent` or `parent/opforitem`
var/result_cut = splicetext(partially_cut, 1, findtext(partially_cut, "/"), "") // now will just be /opforitem
if(!findtext(result_cut, "/"))
continue
compiled_subtypes += opfor
for(var/datum/opposing_force_equipment/opfor_item as anything in compiled_subtypes)
if(!initial(opfor_item.item_type))
Fail("Opposing Force equipment datum [opfor_item] lacks an `item_type`.")
#undef DATUM_PATH_LEN