mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-20 23:06:44 +01:00
19 lines
558 B
Plaintext
19 lines
558 B
Plaintext
// checks hardcoded only (duh!!)
|
|
/datum/unit_test/materials_shall_have_ids/Run()
|
|
var/list/ids = list()
|
|
for(var/path in subtypesof(/datum/prototype/material))
|
|
var/datum/prototype/material/M = path
|
|
// for now we only check initial().
|
|
var/id = initial(M.id)
|
|
if(isnull(id))
|
|
Fail("null id on [path]")
|
|
continue
|
|
if(ids[id])
|
|
Fail("duplicate id [id] on [path] vs [ids[id]]")
|
|
continue
|
|
ids[id] = path
|
|
M = new path
|
|
if(M.id != initial(M.id))
|
|
Fail("id changed on [path] after New(); this behavior will cause things to break.")
|
|
continue
|