Files
Bubberstation/code/modules/unit_tests/objectives.dm
Watermelon914 8fd85e9666 [MDB IGNORE] BIDDLE TRAITORS - Adds progression traitors. Refactors uplink code in its entirety (#63588)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
Co-authored-by: tgstation-server <tgstation-server@tgstation13.org>
Co-authored-by: gbfree <guillaumebfree@gmail.com>
Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com>
Co-authored-by: Changelogs <action@github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com>
Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Azarak <azarak10@gmail.com>
Co-authored-by: RandomGamer123 <31096837+RandomGamer123@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: ike709 <ike709@users.noreply.github.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Pepsilawn <reisenrui@gmail.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: san7890 <34697715+san7890@users.noreply.github.com>
Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
Co-authored-by: Krysonism <49783092+Krysonism@users.noreply.github.com>
Co-authored-by: Aziz Chynaliev <azizonkg@gmail.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
Co-authored-by: Mooshimi <85910816+Mooshimi@users.noreply.github.com>
Co-authored-by: carshalash <carshalash@gmail.com>
Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
2022-01-11 15:47:10 -08:00

25 lines
1.4 KiB
Plaintext

/datum/unit_test/objectives_category/Run()
var/datum/traitor_category_handler/category_handler = allocate(/datum/traitor_category_handler)
var/list/objectives_that_exist = list()
for(var/datum/traitor_objective_category/category as anything in category_handler.all_categories)
for(var/value in category.objectives)
TEST_ASSERT(isnum(category.objectives[value]), "[category.type] does not have a valid format for its objectives as an objective category! ([value] requires a weight to be assigned to it)")
if(islist(value))
recursive_check_list(category.type, value, objectives_that_exist)
else
objectives_that_exist += value
for(var/datum/traitor_objective/objective_typepath as anything in subtypesof(/datum/traitor_objective))
if(initial(objective_typepath.abstract_type) == objective_typepath)
continue
if(!(objective_typepath in objectives_that_exist))
Fail("[objective_typepath] is not in a traitor category and isn't an abstract type! Place it into a [/datum/traitor_objective_category] or remove it from code.")
/datum/unit_test/objectives_category/proc/recursive_check_list(base_type, list/to_check, list/to_add_to)
for(var/value in to_check)
TEST_ASSERT(isnum(to_check[value]), "[base_type] does not have a valid format for its objectives as an objective category! ([value] requires a weight to be assigned to it)")
if(islist(value))
recursive_check_list(base_type, value, to_add_to)
else
to_add_to += value