Files
Aurora.3/code/unit_tests/origins_tests.dm
Fluffy a4f8285686 Refactor of, and more, unit tests (#16065)
* Initial experiment

* holy shit the pain of this rabbit hole

* F

* F

* F

* F

* FFF

* FFFF

* FFFFFFFFF

* FFFFFFFFFF

* FF

* ffffff

* ffffffff

* F^F

* FFFFFF

* F

* Robusted

* F

* Some readability, hopefully

* Fear

* Aurora was a mistake

* Horrors beyond our comprehension

* Use the appropriate macro across the tests

* Brah

* FF

* Mute janitors robusting the ling

* Frail doctors revealing to be more trained than a KGB sleeper agent when the crew armory opens

* FFFFFFF

* gujbjh

* Shitcode, shitcode everywhere

* Pain

* Cursed codebase

* Fix AI mask qdel, SQL tests to macro

* Attempt at github grouping

* Take two

* Brah

* Maybe this looks better

* Different formatting

* FFS

* Visuals

* pain

* FFFFF

* hyuh

* fgdsgd

* igyguybujgb

* Just calling the parent here

* dsfs

* fdsaf

* Move more pieces to use the macros

* Finish moving to macro

* gah

* Changelog, some touchups

* Fix another found runtime

* GDI
2023-04-03 10:47:31 +00:00

66 lines
2.4 KiB
Plaintext

/datum/unit_test/cultures
name = "Cultures Test - All cultures shall be filled out"
/datum/unit_test/cultures/start_test()
var/failures = 0
var/list/singleton/origin_item/culture/all_cultures = GET_SINGLETON_SUBTYPE_MAP(/singleton/origin_item/culture)
for(var/singleton/origin_item/culture/OC in all_cultures)
if(!istext(OC.name))
TEST_FAIL("Culture [OC.name] does not have a name!")
failures++
if(!istext(OC.desc))
TEST_FAIL("Culture [OC.name] does not have a description!")
failures++
if(!islist(OC.possible_origins))
TEST_FAIL("Culture [OC.name]'s possible_origins list is not a list!")
failures++
if(!length(OC.possible_origins))
TEST_FAIL("Culture [OC.name] does not have any possible origins!")
failures++
if(failures)
TEST_FAIL("[failures] error(s) found.")
else
TEST_PASS("All cultures are filled out properly.")
return TRUE
/datum/unit_test/origins
name = "Origins Test - All origins shall be filled out"
/datum/unit_test/origins/start_test()
var/failures = 0
var/list/singleton/origin_item/origin/all_origins = GET_SINGLETON_SUBTYPE_MAP(/singleton/origin_item/origin)
for(var/singleton/origin_item/origin/OI in all_origins)
if(!istext(OI.name))
TEST_FAIL("Origin [OI.name] does not have a name!")
failures++
if(!istext(OI.desc))
TEST_FAIL("Origin [OI.name] does not have a description!")
failures++
if(!islist(OI.possible_accents) || !islist(OI.possible_citizenships) || !islist(OI.possible_religions))
TEST_FAIL("Origin [OI.name] is missing at least one list in the possible accents, citizenships or religions!")
failures++
if(!length(OI.possible_accents) || !length(OI.possible_citizenships) || !length(OI.possible_religions))
TEST_FAIL("Origin [OI.name] is missing at least one entry in the possible accents, citizenships or religions lists!")
failures++
if(failures)
TEST_FAIL("[failures] error(s) found.")
else
TEST_PASS("All origins are filled out properly.")
return TRUE
/datum/unit_test/accent_tags
name = "All accent tags shall have a text tag"
/datum/unit_test/accent_tags/start_test()
var/failures = 0
for(var/datum/accent/A in subtypesof(/datum/accent))
A = new()
if(!istext(A.text_tag))
TEST_FAIL("Accent tag [A.name] did not have a text tag or the type was inappropriate!")
failures++
if(failures)
TEST_FAIL("[failures] errors found.")
else
TEST_PASS("All accents have a text tag.")
return TRUE