From fe330e6d836d1825934577dcd2901dcf4cad7ed1 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Sat, 27 Apr 2024 12:46:38 +1000 Subject: [PATCH] add remove_detached_inventory call and test it too --- games/devtest/mods/unittests/inventory.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/games/devtest/mods/unittests/inventory.lua b/games/devtest/mods/unittests/inventory.lua index c645e3544d..078bc5d6a9 100644 --- a/games/devtest/mods/unittests/inventory.lua +++ b/games/devtest/mods/unittests/inventory.lua @@ -64,6 +64,10 @@ local function test_inventory() pcall(inv.set_list, inv, "test", true) local after = inv:get_list("test") assert(compare_lists(before, after)) + + local location = inv:get_location() + assert(minetest.remove_detached_inventory("test")) + assert(not minetest.get_inventory(location)) end unittests.register("test_inventory", test_inventory)