aboutsummaryrefslogtreecommitdiff
path: root/clientmods/preview/example.lua
diff options
context:
space:
mode:
authorJosiahWI <41302989+JosiahWI@users.noreply.github.com>2022-06-26 08:37:50 -0500
committerGitHub <noreply@github.com>2022-06-26 14:37:50 +0100
commit4163c872af4fd75ea48b4acfe81888450e0749e6 (patch)
tree0 files changed, 0 insertions, 0 deletions
l opt">("handles characters", function() local test_in = {escape_chars="\n\r\t\v\\\"\'", non_european="θשׁ٩∂"} local test_out = core.deserialize(core.serialize(test_in)) assert.same(test_in, test_out) end) it("handles precise numbers", function() local test_in = 0.2695949158945771 local test_out = core.deserialize(core.serialize(test_in)) assert.same(test_in, test_out) end) it("handles big integers", function() local test_in = 269594915894577 local test_out = core.deserialize(core.serialize(test_in)) assert.same(test_in, test_out) end) it("handles recursive structures", function() local test_in = { hello = "world" } test_in.foo = test_in local test_out = core.deserialize(core.serialize(test_in)) assert.same(test_in, test_out) end) it("strips functions in safe mode", function() local test_in = { func = function(a, b) error("test") end, foo = "bar"