-
Notifications
You must be signed in to change notification settings - Fork 819
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an implanting unit test (#13691)
* Adds an implanting unit test * Update implanting.dm * Update implanter.dm
- Loading branch information
1 parent
b370eda
commit ea9219b
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
///Implants a human to make sure it effectively is inserted and deleted. | ||
/datum/unit_test/implanting | ||
|
||
/datum/unit_test/implanting/Run() | ||
var/mob/living/carbon/human/implanted_guy = allocate(/mob/living/carbon/human) | ||
var/obj/item/implanter/implanter_to_inject = allocate(/obj/item/implanter/cloak) | ||
|
||
var/obj/item/implant/implant_in_planter = implanter_to_inject.imp | ||
|
||
implanted_guy.put_in_active_hand(implanter_to_inject) | ||
|
||
TEST_ASSERT(implanter_to_inject.attack(implanted_guy, implanted_guy), "[implanted_guy] failed to inject himself with [implanter_to_inject]") | ||
TEST_ASSERT(!implanter_to_inject.imp, "[implanter_to_inject] still has an implant in its implanter, despite being injected into [implanted_guy]") | ||
|
||
qdel(implanted_guy) | ||
TEST_ASSERT(QDELETED(implant_in_planter), "[implant_in_planter] has been injected into [implanted_guy], who has been deleted, but the implant still exists.") |