mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 21:19:44 +01:00
Unit Test rework & Master/Ticker update (#17912)
* Unit Test rework & Master/Ticker update * Fixes and working unit testing * Fixes * Test fixes and FA update * Fixed runtimes * Radio subsystem * move that glob wherever later * ident * CIBUILDING compile option * Fixed runtimes * Some changes to the workflow * CI Split * More split * Pathing * Linters and Annotators * ci dir fix * Missing undef fixed * Enable grep checks * More test conversions * More split * Correct file * Removes unneeded inputs * oop * More dependency changes * More conversions * Conversion fixes * Fixes * Some assert fixes * Corrects start gate * Converted some README.dms to README.mds * Removes duplicate proc * Removes unused defines * Example configs * fix dll access viol by double calling * Post-rebase fixes * Cleans up names global list * Undef restart counter * More code/game/ cleanup * Statpanel update * Skybox * add * Fix ticker * Roundend fix * Persistence dependency update * Reordering * Reordering * Reordering * Initstage fix * . * . * Reorder * Reorder * Circle * Mobs * Air * Test fix * CI Script Fix * Configs * More ticker stuff * This is now in 'reboot world' * Restart world announcements * no glob in PreInit * to define * Update * Removed old include * Make this file normal again * moved * test * shared unit testing objects * Updates batched_spritesheets and universal_icon * . * job data debug * rm that * init order * show us * . * i wonder * . * . * urg * do we not have a job ID? * . * rm sleep for now * updated rust-g linux binaries * binaries update 2 * binaries update 3 * testing something * change that * test something * . * . * . * locavar * test * move that * . * debug * don't run this test * strack trace it * cleaner * . * . * cras again * also comment this out * return to official rust g * Update robot_icons.dm * monitor the generation * . --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/// Test that all traits have unique names
|
||||
/datum/unit_test/all_traits_unique_names
|
||||
|
||||
/datum/unit_test/all_traits_unique_names/Run()
|
||||
var/list/used_named = list()
|
||||
for(var/traitpath in GLOB.all_traits)
|
||||
var/datum/trait/T = GLOB.all_traits[traitpath]
|
||||
TEST_ASSERT(!(T.name in used_named), "[T.type]: Trait - The name \"[T.name]\" is already in use.")
|
||||
used_named.Add(T.name)
|
||||
|
||||
/// Test that autohiss traits shall be excluse
|
||||
/datum/unit_test/autohiss_shall_be_exclusive
|
||||
|
||||
/datum/unit_test/autohiss_shall_be_exclusive/Run()
|
||||
var/list/hiss_list = list()
|
||||
for(var/traitpath in GLOB.all_traits)
|
||||
var/datum/trait/T = GLOB.all_traits[traitpath]
|
||||
if(!T.var_changes)
|
||||
continue
|
||||
if(!islist(T.var_changes["autohiss_basic_map"]))
|
||||
continue
|
||||
hiss_list += T
|
||||
|
||||
for(var/datum/trait/T in hiss_list)
|
||||
TEST_ASSERT(!(T.type in T.excludes), "[T.type]: Trait - Autohiss excludes itself.")
|
||||
TEST_ASSERT(T.excludes, "[T.type]: Trait - Autohiss missing exclusion list.")
|
||||
|
||||
if(!T.excludes)
|
||||
continue
|
||||
|
||||
var/list/exempt_list = hiss_list.Copy() - T // MUST exclude all others except itself
|
||||
for(var/datum/trait/EX in exempt_list)
|
||||
TEST_ASSERT(EX.type in T.excludes, "[T.type]: Trait - Autohiss missing exclusion for [EX].")
|
||||
Reference in New Issue
Block a user