diff options
Diffstat (limited to 'builtin/common/tests')
-rw-r--r-- | builtin/common/tests/misc_helpers_spec.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/common/tests/misc_helpers_spec.lua b/builtin/common/tests/misc_helpers_spec.lua index f6ad96619..7d046d5b7 100644 --- a/builtin/common/tests/misc_helpers_spec.lua +++ b/builtin/common/tests/misc_helpers_spec.lua @@ -163,3 +163,11 @@ describe("table", function() assert.equal(-1, table.indexof({"foo", "bar"}, "baz")) end) end) + +describe("formspec_escape", function() + it("escapes", function() + assert.equal(nil, core.formspec_escape(nil)) + assert.equal("", core.formspec_escape("")) + assert.equal("\\[Hello\\\\\\[", core.formspec_escape("[Hello\\[")) + end) +end) |