mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
unit test for /obj/item/stack singular_name (#66378)
Checks if all non-blacklisted stack items have singular_name set, because apparently that's pretty important Gives it to a few ones that didn't
This commit is contained in:
@@ -110,6 +110,7 @@
|
||||
#include "species_config_sanity.dm"
|
||||
#include "species_unique_id.dm"
|
||||
#include "species_whitelists.dm"
|
||||
#include "stack_singular_name.dm"
|
||||
#include "stomach.dm"
|
||||
#include "strippable.dm"
|
||||
#include "subsystem_init.dm"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Goes through every subtype of /obj/item/stack to check for a singular name, var/singular_name.
|
||||
* Everything within the blacklist does not need to be tested because it exists to be overriden.
|
||||
* This test will fail if a subtype of /obj/item/stack is missing a singular name.
|
||||
*/
|
||||
/datum/unit_test/stack_singular_name
|
||||
|
||||
/datum/unit_test/stack_singular_name/Run()
|
||||
var/list/blacklist = list( // all of these are generally parents that exist to be overriden; ex. /obj/item/stack/license_plates exists to branch into /filled and /empty
|
||||
/obj/item/stack/sheet,
|
||||
/obj/item/stack/sheet/mineral,
|
||||
/obj/item/stack/license_plates,
|
||||
/obj/item/stack/sheet/animalhide,
|
||||
)
|
||||
|
||||
for(var/obj/item/stack/stack_check as anything in subtypesof(/obj/item/stack) - blacklist)
|
||||
if(!initial(stack_check.singular_name))
|
||||
Fail("[stack_check] is missing a singular name!")
|
||||
Reference in New Issue
Block a user