Skip to content

Commit

Permalink
moved handle_fn_result
Browse files Browse the repository at this point in the history
  • Loading branch information
VorTechnix committed Oct 18, 2024
1 parent 3d205fa commit 2354e51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions worldeditadditions_commands/commands/test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
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
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 || <testname> <args> || help <testname>",
description = "Run a test or list all tests",
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion worldeditadditions_core/utils/format/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 2354e51

Please sign in to comment.