[MIRROR] Adds a unit test for dupe planes [MDB IGNORE] (#16489)

* Adds a unit test for dupe planes (#70129)

* Adds a unit test for dupe planes

Co-authored-by: Time-Green <timkoster1@hotmail.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2022-09-28 07:04:47 -07:00
committed by GitHub
co-authored by Time-Green Tastyfish
parent 543d7437dd
commit 55fb2abc7e
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -130,6 +130,7 @@
#include "outfit_sanity.dm"
#include "paintings.dm"
#include "pills.dm"
#include "plane_dupe_detector.dm"
#include "plantgrowth_tests.dm"
#include "preference_species.dm"
#include "preferences.dm"
@@ -0,0 +1,12 @@
///Checks if we don't have two planes on the same layer
/datum/unit_test/plane_dupe_detector
/datum/unit_test/plane_dupe_detector/Run()
var/list/plane_integer_list = list()
for(var/atom/movable/screen/plane_master/plane_path as anything in subtypesof(/atom/movable/screen/plane_master))
if(!initial(plane_path.plane))
continue
if(plane_integer_list.Find("[initial(plane_path.plane)]"))
var/atom/movable/screen/plane_master/duplicate_plane_path = plane_integer_list["[initial(plane_path.plane)]"]
TEST_FAIL("PLANE CONFLICT DETECTED!! The [initial(plane_path.name)] and [initial(duplicate_plane_path.name)] both use plane [initial(plane_path.plane)].")
plane_integer_list["[initial(plane_path.plane)]"] = plane_path