Files
Bubberstation/code/modules/unit_tests/hydroponics_self_mutations.dm
SkyratBot 92ceb04576 [MIRROR] Fixes + unit tests botany plants mutating into themselves, and makes mutatelists proper lazylists (#8004)
* Fixes + unit tests botany plants mutating into themselves, and makes mutatelists proper lazylists

* fixes merge issues

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
2021-09-06 07:55:30 -04:00

12 lines
531 B
Plaintext

/// Unit test to ensure plants can't self-mutate into themselves.
/datum/unit_test/hydroponics_self_mutation
/datum/unit_test/hydroponics_self_mutation/Run()
var/list/all_seeds = subtypesof(/obj/item/seeds)
for(var/seed in all_seeds)
var/obj/item/seeds/instantiated_seed = new seed()
for(var/path in instantiated_seed.mutatelist)
TEST_ASSERT(!istype(instantiated_seed, path), "[instantiated_seed] - [instantiated_seed.type] is able to mutate into itself! Its mutatelist is not set correctly.")
qdel(instantiated_seed)