summaryrefslogtreecommitdiff
path: root/builtin/common/misc_helpers.lua
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-01-18 02:09:18 +0000
committerGitHub <noreply@github.com>2020-01-18 02:09:18 +0000
commit1173ff0c13a07dec2ede3166378dc5f50fff37b3 (patch)
treedf83476a7389fce570fb2bb6852e0de024d20e98 /builtin/common/misc_helpers.lua
parent6d472b1840971a087841ea7feee5a921fb82b84a (diff)
downloadminetest-1173ff0c13a07dec2ede3166378dc5f50fff37b3.tar.gz
minetest-1173ff0c13a07dec2ede3166378dc5f50fff37b3.tar.bz2
minetest-1173ff0c13a07dec2ede3166378dc5f50fff37b3.zip
Add Lua unit tests to builtin using busted (#9184)
Diffstat (limited to 'builtin/common/misc_helpers.lua')
-rw-r--r--builtin/common/misc_helpers.lua11
1 files changed, 0 insertions, 11 deletions
diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua
index 199f13cd1..e4c7f4aa3 100644
--- a/builtin/common/misc_helpers.lua
+++ b/builtin/common/misc_helpers.lua
@@ -200,9 +200,6 @@ function table.indexof(list, val)
return -1
end
-assert(table.indexof({"foo", "bar"}, "foo") == 1)
-assert(table.indexof({"foo", "bar"}, "baz") == -1)
-
--------------------------------------------------------------------------------
if INIT ~= "client" then
function file_exists(filename)
@@ -220,8 +217,6 @@ function string:trim()
return (self:gsub("^%s*(.-)%s*$", "%1"))
end
-assert(string.trim("\n \t\tfoo bar\t ") == "foo bar")
-
--------------------------------------------------------------------------------
function math.hypot(x, y)
local t
@@ -520,9 +515,6 @@ function core.string_to_pos(value)
return nil
end
-assert(core.string_to_pos("10.0, 5, -2").x == 10)
-assert(core.string_to_pos("( 10.0, 5, -2)").z == -2)
-assert(core.string_to_pos("asd, 5, -2)") == nil)
--------------------------------------------------------------------------------
function core.string_to_area(value)
@@ -764,6 +756,3 @@ function core.privs_to_string(privs, delim)
end
return table.concat(list, delim)
end
-
-assert(core.string_to_privs("a,b").b == true)
-assert(core.privs_to_string({a=true,b=true}) == "a,b")