From 46c7e56d00f89fb2123b49c6df79c9f1ab18a905 Mon Sep 17 00:00:00 2001 From: fallcon Date: Thu, 10 Oct 2024 04:34:39 -0500 Subject: [PATCH] sanity --- code/modules/unit_tests/gun_sanity.dm | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 code/modules/unit_tests/gun_sanity.dm diff --git a/code/modules/unit_tests/gun_sanity.dm b/code/modules/unit_tests/gun_sanity.dm new file mode 100644 index 000000000000..987bcce89252 --- /dev/null +++ b/code/modules/unit_tests/gun_sanity.dm @@ -0,0 +1,7 @@ +/datum/unit_test/gun_sanity/Run() + for(var/gun_type in subtypesof(/obj/item/gun)) + var/obj/item/gun/target_gun = new gun_type() + if(target_gun.default_ammo_type) + TEST_ASSERT(istype(target_gun.default_ammo_type), "The default ammo in [target_gun.type] is not a type") + TEST_ASSERT(target_gun.default_ammo_type in target_gun.allowed_ammo_types, "The default ammo in [target_gun.type] in not in its allowed ammo types") + qdel(target_gun)