]> git.lizzy.rs Git - minetest.git/blob - games/devtest/mods/unittests/inside_async_env.lua
Add missing item alias metatables to async environment (#12458)
[minetest.git] / games / devtest / mods / unittests / inside_async_env.lua
1 unittests = {}
2
3 core.log("info", "Hello World")
4
5 local function do_tests()
6         assert(core == minetest)
7         -- stuff that should not be here
8         assert(not core.get_player_by_name)
9         assert(not core.set_node)
10         assert(not core.object_refs)
11         -- stuff that should be here
12         assert(ItemStack)
13         assert(core.registered_items[""])
14         -- alias handling
15         assert(core.registered_items["unittests:steel_ingot_alias"].name ==
16                 "unittests:steel_ingot")
17 end
18
19 function unittests.async_test()
20         local ok, err = pcall(do_tests)
21         if not ok then
22                 core.log("error", err)
23         end
24         return ok
25 end