mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Adds unit tests
Port of https://github.com/Baystation12/Baystation12/pull/11808 and several others Fixes three overlapping cables ([192 / 158 / 1], [214 / 161 / 1], [122 / 197 / 1]) Fixes drill and mech drill having the same ID.
This commit is contained in:
23
code/unit_tests/loadout_tests.dm
Normal file
23
code/unit_tests/loadout_tests.dm
Normal file
@@ -0,0 +1,23 @@
|
||||
/datum/unit_test/loadout_test_shall_have_name_cost_path
|
||||
name = "LOADOUT: Entries shall have name, cost, and path definitions"
|
||||
|
||||
/datum/unit_test/loadout_test_shall_have_name_cost_path/start_test()
|
||||
var/failed = 0
|
||||
for(var/geartype in typesof(/datum/gear) - /datum/gear)
|
||||
var/datum/gear/G = geartype
|
||||
|
||||
if(!initial(G.display_name))
|
||||
log_unit_test("[G]: Loadout - Missing display name.")
|
||||
failed = 1
|
||||
else if(!initial(G.cost))
|
||||
log_unit_test("[G]: Loadout - Missing cost.")
|
||||
failed = 1
|
||||
else if(!initial(G.path))
|
||||
log_unit_test("[G]: Loadout - Missing path definition.")
|
||||
failed = 1
|
||||
|
||||
if(failed)
|
||||
fail("One or more /datum/gear definitions had invalid display names, costs, or path definitions")
|
||||
else
|
||||
pass("All /datum/gear definitions had correct settings.")
|
||||
return 1
|
||||
Reference in New Issue
Block a user