mirror of
https://github.com/minetest/minetest.git
synced 2024-12-04 21:43:44 +01:00
14 lines
651 B
Lua
14 lines
651 B
Lua
-- Test item (un)registration and overriding
|
|
do
|
|
local itemname = "unittests:test_override_item"
|
|
core.register_craftitem(":" .. itemname, {description = "foo"})
|
|
assert(assert(core.registered_items[itemname]).description == "foo")
|
|
core.override_item(itemname, {description = "bar"})
|
|
assert(assert(core.registered_items[itemname]).description == "bar")
|
|
core.override_item(itemname, {}, {"description"})
|
|
-- description has the empty string as a default
|
|
assert(assert(core.registered_items[itemname]).description == "")
|
|
core.unregister_item("unittests:test_override_item")
|
|
assert(core.registered_items["unittests:test_override_item"] == nil)
|
|
end
|