Merge pull request #52433 from Jared-Fogle/metabolization-tests

Add unit tests for metabolizing of all reagents and fix the ones that failed
This commit is contained in:
ShizCalev
2020-07-24 22:30:15 -04:00
committed by SkyratBot
parent cf47c08045
commit ea351bc9ac
7 changed files with 34 additions and 14 deletions
+1
View File
@@ -16,6 +16,7 @@
#include "chain_pull_through_space.dm"
#include "component_tests.dm"
#include "keybinding_init.dm"
#include "metabolizing.dm"
#include "outfit_sanity.dm"
#include "plantgrowth_tests.dm"
#include "reagent_id_typos.dm"
+19
View File
@@ -0,0 +1,19 @@
/datum/unit_test/metabolization/Run()
// Pause natural mob life so it can be handled entirely by the test
SSmobs.pause()
var/mob/living/carbon/human/human = allocate(/mob/living/carbon/human)
var/mob/living/carbon/monkey/monkey = allocate(/mob/living/carbon/monkey)
for (var/reagent_type in subtypesof(/datum/reagent))
test_reagent(human, reagent_type)
test_reagent(monkey, reagent_type)
/datum/unit_test/metabolization/proc/test_reagent(mob/living/carbon/C, reagent_type)
C.reagents.add_reagent(reagent_type, 10)
C.reagents.metabolize(C, can_overdose = TRUE)
C.reagents.clear_reagents()
/datum/unit_test/metabolization/Destroy()
SSmobs.ignite()
return ..()