mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 06:40:08 +01:00
[MIRROR] Unit Test rework & Master/Ticker update (#11372)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/// converted unit test, maybe should be fully refactored
|
||||
|
||||
/datum/unit_test/emotes_shall_have_unique_keys/Run()
|
||||
var/list/keys = list()
|
||||
var/list/duplicates = list()
|
||||
|
||||
var/list/all_emotes = decls_repository.get_decls_of_subtype(/decl/emote)
|
||||
for(var/etype in all_emotes)
|
||||
var/decl/emote/emote = all_emotes[etype]
|
||||
if(!emote.key)
|
||||
continue
|
||||
if(emote.key in keys)
|
||||
if(!duplicates[emote.key])
|
||||
duplicates[emote.key] = list()
|
||||
duplicates[emote.key] += etype
|
||||
else
|
||||
keys += emote.key
|
||||
|
||||
TEST_ASSERT(!length(duplicates), "[length(duplicates)] emote\s had overlapping keys: [english_list(duplicates)].")
|
||||
Reference in New Issue
Block a user