aboutsummaryrefslogtreecommitdiff
path: root/builtin/common/tests/misc_helpers_spec.lua
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2023-01-10 09:25:48 -0500
committerGitHub <noreply@github.com>2023-01-10 09:25:48 -0500
commitab1fe80150a8031fb702b9ff776db2db4dea89a4 (patch)
treee84252b4e32e9c7b65f60cec101c16335756eb47 /builtin/common/tests/misc_helpers_spec.lua
parenta3177b89d8e68d39b8e2ad24e88cd87820d1135a (diff)
downloadminetest-ab1fe80150a8031fb702b9ff776db2db4dea89a4.tar.xz
Error when string.split is given empty separator (#13132)
Diffstat (limited to 'builtin/common/tests/misc_helpers_spec.lua')
-rw-r--r--builtin/common/tests/misc_helpers_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/common/tests/misc_helpers_spec.lua b/builtin/common/tests/misc_helpers_spec.lua
index ff0f0298a..73a66737f 100644
--- a/builtin/common/tests/misc_helpers_spec.lua
+++ b/builtin/common/tests/misc_helpers_spec.lua
@@ -38,6 +38,12 @@ describe("string", function()
assert.same({ "one", "two" }, string.split("one,two", ",", false, -1, true))
assert.same({ "one", "two", "three" }, string.split("one2two3three", "%d", false, -1, true))
end)
+
+ it("rejects empty separator", function()
+ assert.has.errors(function()
+ string.split("", "")
+ end)
+ end)
end)
end)