aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/unittests/misc.lua
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-11-28 07:21:43 -0500
committerGitHub <noreply@github.com>2022-11-28 07:21:43 -0500
commitd0a118f5b1a2cada1d46d4acac55a998e268154d (patch)
tree72e38e81f8f9ef0d89a6deafa74daa6a261ad49e /games/devtest/mods/unittests/misc.lua
parent3fd5bff128cacb068c0758d0b33b425dc88beed7 (diff)
downloadminetest-d0a118f5b1a2cada1d46d4acac55a998e268154d.tar.xz
Add `minetest.get_game_info` and allow reading `game.conf` (#12989)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'games/devtest/mods/unittests/misc.lua')
-rw-r--r--games/devtest/mods/unittests/misc.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/games/devtest/mods/unittests/misc.lua b/games/devtest/mods/unittests/misc.lua
index 8ac3ed110..7c16b7c82 100644
--- a/games/devtest/mods/unittests/misc.lua
+++ b/games/devtest/mods/unittests/misc.lua
@@ -103,3 +103,10 @@ local function test_compress()
end
unittests.register("test_compress", test_compress)
+local function test_game_info()
+ local info = minetest.get_game_info()
+ local game_conf = Settings(info.path .. "/game.conf")
+ assert(info.id == "devtest")
+ assert(info.title == game_conf:get("title"))
+end
+unittests.register("test_game_info", test_game_info)