mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 20:20:33 +01:00
[MIRROR] Adds a unit test to make sure the right amount of colors are supplied to GAGS configurations (#6048)
* Adds a unit test to make sure the right amount of colors are supplied to GAGS configurations * Mirror! Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com> Co-authored-by: Funce <funce.973@gmail.com>
This commit is contained in:
co-authored by
Emmett Gaines
Funce
parent
d44d612fcb
commit
95cb271fee
@@ -22,3 +22,18 @@
|
||||
var/belt_icon_state = initial(item_path.belt_icon_state) || initial(item_path.icon_state)
|
||||
if(belt && !belt.icon_states[belt_icon_state])
|
||||
Fail("[belt.DebugName()] is missing a sprite for the belt overlay for [item_path]. Expected icon state: '[belt_icon_state]'")
|
||||
|
||||
/// Makes sure objects using greyscale configs have, if any, the correct number of colors
|
||||
/datum/unit_test/greyscale_color_count
|
||||
|
||||
/datum/unit_test/greyscale_color_count/Run()
|
||||
for(var/atom/thing as anything in subtypesof(/atom))
|
||||
var/datum/greyscale_config/config = SSgreyscale.configurations["[initial(thing.greyscale_config)]"]
|
||||
if(!config)
|
||||
continue
|
||||
var/list/colors = splittext(initial(thing.greyscale_colors), "#")
|
||||
if(!length(colors))
|
||||
continue
|
||||
var/number_of_colors = length(colors) - 1
|
||||
if(config.expected_colors != number_of_colors)
|
||||
Fail("[thing] has the wrong amount of colors configured for [config.DebugName()]. Expected [config.expected_colors] but only found [number_of_colors].")
|
||||
|
||||
Reference in New Issue
Block a user