From 2354e51ba6594829a933802f45275f61df87b62f Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:01:39 -0700 Subject: [PATCH] moved handle_fn_result --- .../commands/test/helpers}/handle_fn_result.lua | 0 worldeditadditions_commands/commands/test/test.lua | 9 ++++++--- worldeditadditions_core/utils/format/init.lua | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) rename {worldeditadditions_core/utils/format => worldeditadditions_commands/commands/test/helpers}/handle_fn_result.lua (100%) diff --git a/worldeditadditions_core/utils/format/handle_fn_result.lua b/worldeditadditions_commands/commands/test/helpers/handle_fn_result.lua similarity index 100% rename from worldeditadditions_core/utils/format/handle_fn_result.lua rename to worldeditadditions_commands/commands/test/helpers/handle_fn_result.lua diff --git a/worldeditadditions_commands/commands/test/test.lua b/worldeditadditions_commands/commands/test/test.lua index 8130275..28fa024 100644 --- a/worldeditadditions_commands/commands/test/test.lua +++ b/worldeditadditions_commands/commands/test/test.lua @@ -7,10 +7,10 @@ local wea_c = worldeditadditions_core local wea_cmd = worldeditadditions_commands -local test_dir = wea_cmd.modpath .. "/commands/test/tests/" +local test_dir = wea_cmd.modpath .. "/commands/test/" -- Load tests with init function -dofile(test_dir .. "init.lua")(test_dir) +dofile(test_dir .. "tests/init.lua")(test_dir) local tests = worldeditadditions.normalize_test.get_registered_tests() -- Helper functions @@ -18,6 +18,9 @@ local set_colour = function(colour, text) return minetest.colorize(colour, text) end +local handle_fn_result = dofile(test_dir .. "helpers/handle_fn_result.lua") + +-- Main command wea_c.register_command("test", { params = "list || || help ", description = "Run a test or list all tests", @@ -59,7 +62,7 @@ wea_c.register_command("test", { tests[params_text[1]]:help()}, " ") end end - return wea_c.format.handle_fn_result( + return handle_fn_result( tests[subcommand](name, params_text) ) end diff --git a/worldeditadditions_core/utils/format/init.lua b/worldeditadditions_core/utils/format/init.lua index b9178f6..dc75fe3 100644 --- a/worldeditadditions_core/utils/format/init.lua +++ b/worldeditadditions_core/utils/format/init.lua @@ -4,7 +4,6 @@ local wea_c = worldeditadditions_core wea_c.format = { array_2d = dofile(wea_c.modpath.."/utils/format/array_2d.lua"), escape = dofile(wea_c.modpath.."/utils/format/escape.lua"), - handle_fn_result = dofile(wea_c.modpath.."/utils/format/handle_fn_result.lua"), human_size = dofile(wea_c.modpath.."/utils/format/human_size.lua"), human_time = dofile(wea_c.modpath.."/utils/format/human_time.lua"), make_ascii_table = dofile(wea_c.modpath.."/utils/format/make_ascii_table.lua"),