Files
Bubberstation/code/modules/unit_tests/closets.dm
SkyratBot 7ea64cb226 [MIRROR] Fixing issues with contents of some coded or mapped closets exceeding their storage capacity [MDB IGNORE] (#8965)
* Fixing issues with contents of some coded or mapped closets exceeding their storage capacity (#62221)

* Fixing issues with contents of some coded or mapped closets exceeding their storage capacity

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-10-23 00:28:10 +01:00

13 lines
690 B
Plaintext

/// Checks that the length of the initial contents of a closet doesn't exceed its storage capacity
/datum/unit_test/closets
/datum/unit_test/closets/Run()
var/list/all_closets = subtypesof(/obj/structure/closet)
//Supply pods. They are sent, crashed, opened and never closed again. They also cause exceptions in nullspace.
all_closets -= typesof(/obj/structure/closet/supplypod)
for(var/closet_type in all_closets)
var/obj/structure/closet/closet = allocate(closet_type)
var/contents_len = length(closet.contents)
TEST_ASSERT(contents_len <= closet.storage_capacity, "Initial Contents of [closet.type] ([contents_len]) exceed its storage capacity ([closet.storage_capacity]).")