moved handle_fn_result

This commit is contained in:
VorTechnix 2024-10-17 17:01:39 -07:00
parent 3d205fadb7
commit 2354e51ba6
No known key found for this signature in database
GPG key ID: 091E91A69545D5BA
3 changed files with 6 additions and 4 deletions

View file

@ -7,10 +7,10 @@
local wea_c = worldeditadditions_core local wea_c = worldeditadditions_core
local wea_cmd = worldeditadditions_commands 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 -- 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() local tests = worldeditadditions.normalize_test.get_registered_tests()
-- Helper functions -- Helper functions
@ -18,6 +18,9 @@ local set_colour = function(colour, text)
return minetest.colorize(colour, text) return minetest.colorize(colour, text)
end end
local handle_fn_result = dofile(test_dir .. "helpers/handle_fn_result.lua")
-- Main command
wea_c.register_command("test", { wea_c.register_command("test", {
params = "list || <testname> <args> || help <testname>", params = "list || <testname> <args> || help <testname>",
description = "Run a test or list all tests", description = "Run a test or list all tests",
@ -59,7 +62,7 @@ wea_c.register_command("test", {
tests[params_text[1]]:help()}, " ") tests[params_text[1]]:help()}, " ")
end end
end end
return wea_c.format.handle_fn_result( return handle_fn_result(
tests[subcommand](name, params_text) tests[subcommand](name, params_text)
) )
end end

View file

@ -4,7 +4,6 @@ local wea_c = worldeditadditions_core
wea_c.format = { wea_c.format = {
array_2d = dofile(wea_c.modpath.."/utils/format/array_2d.lua"), array_2d = dofile(wea_c.modpath.."/utils/format/array_2d.lua"),
escape = dofile(wea_c.modpath.."/utils/format/escape.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_size = dofile(wea_c.modpath.."/utils/format/human_size.lua"),
human_time = dofile(wea_c.modpath.."/utils/format/human_time.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"), make_ascii_table = dofile(wea_c.modpath.."/utils/format/make_ascii_table.lua"),