1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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