diff options
Diffstat (limited to 'games/minimal/mods')
-rw-r--r-- | games/minimal/mods/test/init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/games/minimal/mods/test/init.lua b/games/minimal/mods/test/init.lua index 9b826bce6..3141b4cf3 100644 --- a/games/minimal/mods/test/init.lua +++ b/games/minimal/mods/test/init.lua @@ -43,21 +43,32 @@ end) local function run_player_meta_tests(player) local meta = player:get_meta() meta:set_string("foo", "bar") + assert(meta:contains("foo")) assert(meta:get_string("foo") == "bar") + assert(meta:get("foo") == "bar") local meta2 = player:get_meta() assert(meta2:get_string("foo") == "bar") + assert(meta2:get("foo") == "bar") assert(meta:equals(meta2)) assert(player:get_attribute("foo") == "bar") meta:set_string("bob", "dillan") assert(meta:get_string("foo") == "bar") assert(meta:get_string("bob") == "dillan") + assert(meta:get("bob") == "dillan") assert(meta2:get_string("foo") == "bar") assert(meta2:get_string("bob") == "dillan") + assert(meta2:get("bob") == "dillan") assert(meta:equals(meta2)) assert(player:get_attribute("foo") == "bar") assert(player:get_attribute("bob") == "dillan") + + meta:set_string("foo", "") + assert(not meta:contains("foo")) + assert(meta:get("foo") == nil) + assert(meta:get_string("foo") == "") + assert(meta:equals(meta2)) end local function run_player_tests(player) |