Files
CHOMPStation2/code/modules/unit_tests/poster_tests.dm

14 lines
858 B
Plaintext

/// converted unit test, maybe should be fully refactored
/datum/unit_test/posters_shall_have_legal_states/Run()
var/list/all_posters = GLOB.decls_repository.get_decls_of_type(/datum/decl/poster)
all_posters -= GLOB.decls_repository.get_decl(/datum/decl/poster/lewd) // Dumb exclusion for now. This really needs to become a valid poster instead of an illegaly made base type
for(var/path in all_posters)
var/datum/decl/poster/D = all_posters[path]
var/obj/structure/sign/poster/P = /obj/structure/sign/poster // The base poster shows ALL subtypes except /lewd, so all posters should function here regardless!
var/icon/I = initial(P.icon)
if(D.icon_override)
I = D.icon_override
TEST_ASSERT(icon_exists(I, D.icon_state), "[D.type]: Poster - missing icon_state \"[D.icon_state]\" in \"[I]\", as [D.icon_override ? "override" : "base"] dmi.")