Files
Bubberstation/code/modules/unit_tests/station_trait_tests.dm
SkyratBot aa8d114bff [MIRROR] Wraps all instances of invoking Fail() into the TEST_FAIL Macro [MDB IGNORE] (#19384)
* Wraps all instances of invoking Fail() into the TEST_FAIL Macro (#73407)

We shouldn't really be invoking the proc itself because then we don't
pass along the failing line/file to our consumers, let's use the macro
in all instances that really need it.

I noticed people were invoking the `Fail()` proc directly rather than
using `TEST_FAIL` instead, so they weren't getting those neat
annotations on their failing code because we never passed along the
failing line/file to actually apply those annotations. That's silly. We
don't even return on `TEST_FAIL` either, so there's no reason to not do
this (only upsides wahoo).

* Wraps all instances of invoking Fail() into the TEST_FAIL Macro

* Correct macro in opfor unit test

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
2023-02-16 19:41:29 -05:00

11 lines
541 B
Plaintext

/// This test spawns various station traits and looks through them to see if there's any errors.
/datum/unit_test/station_traits
/datum/unit_test/station_traits/Run()
var/datum/station_trait/cybernetic_revolution/cyber_trait = allocate(/datum/station_trait/cybernetic_revolution)
for(var/datum/job/job in subtypesof(/datum/job))
if(!(initial(job.job_flags) & JOB_CREW_MEMBER))
continue
if(!(job in cyber_trait.job_to_cybernetic))
TEST_FAIL("Job [job] does not have an assigned cybernetic for [cyber_trait.type] station trait.")