Files
Bubberstation/code/modules/unit_tests/mob_spawn.dm
SkyratBot 64f94d0f14 [MIRROR] Updates Mob_Spawn Unit Test To Use NAMEOF [MDB IGNORE] (#19035)
Updates Mob_Spawn Unit Test To Use NAMEOF (#73035)

## About The Pull Request

One of the key functions of this test is to iterate vars to see if it is
null or not, and then error if something is defined where it should not
be. Just to futureproof this test in case someone changes the name of a
variable on the mob spawner (e.g. haircolor to hair_color), we still
want this unit test to work!

So, let's switch it all over to NAMEOF to ensure that all of our stuff
still works the way we want it: safe-guarded against trivial changes
(it'll throw a compile error if one of these vars are changed, which is
good because it compels the coder to fix it).

I also re-arranged the unit test since we didn't need to have those
bulky lists in the middle of the actual checking code, and it should
work a-okay.
## Why It's Good For The Game

Someone in the future will sob a few tears if this unit test breaks and
remains broken throwing runtimes and bricking tgui or whatever because
it's very easy to just have this unit test not be useful in a very
"simple code improvement"
## Changelog
Nothing that concerns players.

Co-authored-by: san7890 <the@san7890.com>
2023-01-31 02:09:13 +00:00

2.4 KiB