mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
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:
@@ -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"
|
||||
|
||||
@@ -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 ..()
|
||||
Reference in New Issue
Block a user