Skip to content

Commit

Permalink
sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Oct 10, 2024
1 parent f234525 commit 46c7e56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/modules/unit_tests/gun_sanity.dm
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 46c7e56

Please sign in to comment.