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:
29
code/unit_tests/mob_tests.dm
Normal file
29
code/unit_tests/mob_tests.dm
Normal file
@@ -0,0 +1,29 @@
|
||||
/datum/unit_test/space_suffocation
|
||||
name = "MOB: human mob suffocates in space"
|
||||
|
||||
var/startOxyloss
|
||||
var/endOxyloss
|
||||
var/mob/living/carbon/human/H
|
||||
async = 1
|
||||
|
||||
/datum/unit_test/space_suffocation/start_test()
|
||||
var/turf/space/T = locate()
|
||||
|
||||
H = new(T)
|
||||
startOxyloss = H.getOxyLoss()
|
||||
|
||||
return 1
|
||||
|
||||
/datum/unit_test/space_suffocation/check_result()
|
||||
if(H.life_tick < 10)
|
||||
return 0
|
||||
|
||||
endOxyloss = H.getOxyLoss()
|
||||
|
||||
if(startOxyloss < endOxyloss)
|
||||
pass("Human mob takes oxygen damage in space. (Before: [startOxyloss]; after: [endOxyloss])")
|
||||
else
|
||||
fail("Human mob is not taking oxygen damage in space. (Before: [startOxyloss]; after: [endOxyloss])")
|
||||
|
||||
qdel(H)
|
||||
return 1
|
||||
Reference in New Issue
Block a user