]> git.lizzy.rs Git - minetest.git/blobdiff - builtin/common/tests/misc_helpers_spec.lua
Error when string.split is given empty separator (#13132)
[minetest.git] / builtin / common / tests / misc_helpers_spec.lua
index ff0f0298ab51f9436f8b60eaefc77519aabb70a1..73a66737fde61feb8e4d241bc9706e5f3e0933dd 100644 (file)
@@ -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)