Files
Aurora.3/code/unit_tests/spawner_tests.dm
harryob 578bae6f6f no relative pathing (#16234)
* the voices win in the end

* cleanup

* changelog

* secure.dm hates me

* make_exact_fit() in initialize instead of whatever was happening before
2023-04-30 21:10:13 +00:00

40 lines
1.1 KiB
Plaintext

/*
*
* Unit Test Template
* This file is not used.
*
*/
/datum/unit_test/template
name = "Ghost Spawner Tests" // If it's a template leave the word "template" in it's name so it's not ran.
/datum/unit_test/template/start_test()
var/list/ignore_spawners = list(
/datum/ghostspawner/human,
/datum/ghostspawner/human/admin,
/datum/ghostspawner/human/admin/corporate,
/datum/ghostspawner/simplemob,
/datum/ghostspawner/human/ert
)
var/failed_checks = 0
var/checks = 0
for(var/spawner in subtypesof(/datum/ghostspawner))
checks++
var/datum/ghostspawner/G = new spawner
if(instances_of_type_in_list(G,ignore_spawners, strict = TRUE))
continue
//Check if we hae name, short_name and desc set
if(!G.short_name || !G.name || !G.desc)
TEST_FAIL("Invalid Spawner: Type:[G.type], Short-Name:[G.short_name], Name:[G.name]")
failed_checks++
if(failed_checks)
TEST_FAIL("\[[failed_checks] / [checks]\] Ghost Spawners are invalid")
else
TEST_PASS("All Ghost Spawners are valid.")
return 1
// ============================================================================