1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Add missing item alias metatables to async environment (#12458)

This commit is contained in:
sfan5
2022-07-04 01:06:42 +02:00
committed by GitHub
parent 34f15259fa
commit fc3460470a
6 changed files with 35 additions and 10 deletions

View File

@@ -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