Files
Yogstation/code/modules/unit_tests/dynamic_ruleset_sanity.dm
John Willard 74fcaf2af6 Updates unit testing (+ adds some new ones) (#19186)
* Updates our unit testing to be much better than it is now

Updates our unit testing to somewhat more functional ones ported from TG
I also added 2 new unit tests to serve as examples, mapping and job landmarks.

* Revert some minor things

* Fixes the log file

* Update unit_tests.dm

* adds a missing icon

* additional changes
2023-06-13 19:49:40 -05:00

14 lines
706 B
Plaintext

/// Verifies that roundstart dynamic rulesets are setup properly without external configuration.
/datum/unit_test/dynamic_roundstart_ruleset_sanity
/datum/unit_test/dynamic_roundstart_ruleset_sanity/Run()
for (var/datum/dynamic_ruleset/roundstart/ruleset as anything in subtypesof(/datum/dynamic_ruleset/roundstart))
var/has_scaling_cost = initial(ruleset.scaling_cost)
var/is_lone = initial(ruleset.flags) & (LONE_RULESET | HIGH_IMPACT_RULESET)
if (has_scaling_cost && is_lone)
TEST_FAIL("[ruleset] has a scaling_cost, but is also a lone/highlander ruleset.")
else if (!has_scaling_cost && !is_lone)
TEST_FAIL("[ruleset] has no scaling cost, but is also not a lone/highlander ruleset.")