aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/unittests/inside_async_env.lua
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-07-04 01:06:42 +0200
committerGitHub <noreply@github.com>2022-07-04 01:06:42 +0200
commitfc3460470aec8d73317d2b35edf195bfeec2852c (patch)
treeacfee4e29064b04726bb65b1e0cf026c82834e28 /games/devtest/mods/unittests/inside_async_env.lua
parent34f15259fa5546dc9abaf974ca5385c276443697 (diff)
downloadhax-minetest-server-fc3460470aec8d73317d2b35edf195bfeec2852c.tar.gz
hax-minetest-server-fc3460470aec8d73317d2b35edf195bfeec2852c.zip
Add missing item alias metatables to async environment (#12458)
Diffstat (limited to 'games/devtest/mods/unittests/inside_async_env.lua')
-rw-r--r--games/devtest/mods/unittests/inside_async_env.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/games/devtest/mods/unittests/inside_async_env.lua b/games/devtest/mods/unittests/inside_async_env.lua
index 9774771f9..4ed0fccd2 100644
--- a/games/devtest/mods/unittests/inside_async_env.lua
+++ b/games/devtest/mods/unittests/inside_async_env.lua
@@ -2,7 +2,7 @@ unittests = {}
core.log("info", "Hello World")
-function unittests.async_test()
+local function do_tests()
assert(core == minetest)
-- stuff that should not be here
assert(not core.get_player_by_name)
@@ -11,5 +11,15 @@ function unittests.async_test()
-- stuff that should be here
assert(ItemStack)
assert(core.registered_items[""])
- return true
+ -- alias handling
+ assert(core.registered_items["unittests:steel_ingot_alias"].name ==
+ "unittests:steel_ingot")
+end
+
+function unittests.async_test()
+ local ok, err = pcall(do_tests)
+ if not ok then
+ core.log("error", err)
+ end
+ return ok
end