diff --git a/beestation.dme b/beestation.dme index 168e1db0c574e..178bae7aa3544 100644 --- a/beestation.dme +++ b/beestation.dme @@ -4098,6 +4098,7 @@ #include "code\modules\tgui_panel\tgui_panel.dm" #include "code\modules\tooltip\tooltip.dm" #include "code\modules\unit_tests\_unit_tests.dm" +#include "code\modules\unit_tests\mapping\map_test.dm" #include "code\modules\uplink\uplink_devices.dm" #include "code\modules\uplink\uplink_items.dm" #include "code\modules\uplink\uplink_purchase_log.dm" diff --git a/code/modules/unit_tests/mapping/map_test.dm b/code/modules/unit_tests/mapping/map_test.dm new file mode 100644 index 0000000000000..671beb241d105 --- /dev/null +++ b/code/modules/unit_tests/mapping/map_test.dm @@ -0,0 +1,38 @@ +/datum/unit_test/map_test/Run() + var/list/failures + var/list/areas = list() + for (var/z in 1 to world.maxz) + if (!is_station_level(z)) + continue + for (var/x in 1 to world.maxx) + for (var/y in 1 to world.maxy) + var/turf/tile = locate(x, y, z) + areas[tile.loc] = TRUE + var/result = check_tile(tile, x == 1 || x == world.maxx || y == 1 || y == world.maxy) + if (result) + LAZYADD(failures, result) + for (var/area/A in areas) + var/result = check_area(A) + if (result) + LAZYADD(failures, result) + if (LAZYLEN(failures)) + TEST_FAIL(jointext(failures, "\n")) + for (var/z in 1 to world.maxz) + if (!is_station_level(z)) + continue + var/result = check_z_level(z) + if (result) + LAZYADD(failures, result) + +/// Return a string if failed, return null otherwise +/datum/unit_test/map_test/proc/check_tile(turf/T, is_map_border) + +/// Return a string if failed, return null otherwise +/datum/unit_test/map_test/proc/check_area(area/T) + +/// Return a string if failed, return null otherwise +/datum/unit_test/map_test/proc/check_z_level(z_value) + +/datum/unit_test/map_test/test/check_tile(turf/T, is_map_border) + if (istype(T, /turf/closed/wall)) + return "[T.type] detected" diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm index 5c17a351c7a93..556bdf7df6ac2 100644 --- a/code/modules/unit_tests/unit_test.dm +++ b/code/modules/unit_tests/unit_test.dm @@ -24,7 +24,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) /proc/focused_tests() var/list/focused_tests = list() - for (var/datum/unit_test/unit_test as anything in subtypesof(/datum/unit_test)) + for (var/datum/unit_test/unit_test as anything in subtypesof(/datum/unit_test) - /datum/unit_test/map_test) if (initial(unit_test.focus)) focused_tests += unit_test