Files
ike709 419b3e7e32 Fixes pointless for() loops (#21613)
OpenDream's `EmptyBlock` pragma had a bug that prevented it from firing
in certain cases of empty `for()` loops. That has been resolved and it's
uncovered a few issues with your code.

Please merge this ASAP as it has no impact on current behavior (besides
saving CPU cycles) and the bad code is currently blocking OpenDream CI
for the linked PR.
2025-11-20 15:36:03 +00:00

27 lines
799 B
Plaintext

/datum/unit_test/species
name = "SPECIES template"
groups = list("generic")
/datum/unit_test/species/injection_mod
name = "SPECIES: All species shall have a valid injection_mod"
// Check that injection_mod is larger than 0. 0 injection_mod is indistinguishable from a failed injection, and a negative injection_mod is meaningless.
/datum/unit_test/species/injection_mod/start_test()
var/list/failed_species = list()
for(var/S in typesof(/datum/species))
var/datum/species/species = S
if(initial(species.injection_mod) > 0)
continue
else
failed_species |= species.type
if(failed_species.len)
TEST_FAIL("SPECIES: Invalid injection_mod var set on species: [english_list(failed_species)]")
else
TEST_PASS("SPECIES: All species had valid injection_mod vars set.")
return 1