summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-03-29 12:07:00 -0400
committerGitHub <noreply@github.com>2022-03-29 18:07:00 +0200
commit06d197cdd042392e1551e5e7244c61300a6bb4e3 (patch)
treec47a0c58917f5f89af1c5128e42611d0d8a3d320 /games
parent11aab4198be1a0f1104a433896e908e4c86de0c9 (diff)
downloadminetest-06d197cdd042392e1551e5e7244c61300a6bb4e3.tar.gz
minetest-06d197cdd042392e1551e5e7244c61300a6bb4e3.tar.bz2
minetest-06d197cdd042392e1551e5e7244c61300a6bb4e3.zip
Store vector metatable in registry
Diffstat (limited to 'games')
-rw-r--r--games/devtest/mods/unittests/misc.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/games/devtest/mods/unittests/misc.lua b/games/devtest/mods/unittests/misc.lua
index cf4f92cfa..ba980866a 100644
--- a/games/devtest/mods/unittests/misc.lua
+++ b/games/devtest/mods/unittests/misc.lua
@@ -36,3 +36,15 @@ local function test_dynamic_media(cb, player)
-- if the callback isn't called this test will just hang :shrug:
end
unittests.register("test_dynamic_media", test_dynamic_media, {async=true, player=true})
+
+local function test_v3f_metatable(player)
+ assert(vector.check(player:get_pos()))
+end
+unittests.register("test_v3f_metatable", test_v3f_metatable, {player=true})
+
+local function test_v3s16_metatable(player, pos)
+ local node = minetest.get_node(pos)
+ local found_pos = minetest.find_node_near(pos, 0, node.name, true)
+ assert(vector.check(found_pos))
+end
+unittests.register("test_v3s16_metatable", test_v3s16_metatable, {map=true})