diff options
author | Kim Alvefur <zash@zash.se> | 2023-03-26 00:49:25 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-03-26 00:49:25 +0100 |
commit | 1a2fdf3f7f6d5ee4394e2e137717f8be8f1a3a20 (patch) | |
tree | 3ca4e8b834f4ebb7a18e57cf739cf267d9e726cd | |
parent | 9bbfb849b1efe753e4d5c7ae56f3b54f0e0827f6 (diff) | |
download | prosody-1a2fdf3f7f6d5ee4394e2e137717f8be8f1a3a20.tar.gz prosody-1a2fdf3f7f6d5ee4394e2e137717f8be8f1a3a20.zip |
util.format: Update tests for serialization changes
-rw-r--r-- | spec/util_format_spec.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/util_format_spec.lua b/spec/util_format_spec.lua index 1016a215..5ea0bdcf 100644 --- a/spec/util_format_spec.lua +++ b/spec/util_format_spec.lua @@ -13,7 +13,7 @@ describe("util.format", function() assert.equal("true", format("%s", true)); assert.equal("[true]", format("%d", true)); assert.equal("% [true]", format("%%", true)); - assert.equal("{ }", format("%q", { })); + assert.equal("{}", format("%q", {})); assert.equal("[1.5]", format("%d", 1.5)); assert.equal("[7.3786976294838e+19]", format("%d", 73786976294838206464)); end); @@ -668,7 +668,7 @@ describe("util.format", function() describe("to %q", function () it("works", function () - assert.matches('{__type="function",__error="fail"}', format("%q", function() end)) + assert.matches('%[%[function: 0[xX]%x+]]', format("%q", function() end)) end); end); @@ -767,7 +767,7 @@ describe("util.format", function() describe("to %q", function () it("works", function () - assert.matches('{__type="thread",__error="fail"}', format("%q", coroutine.create(function() end))) + assert.matches('_%[%[thread: 0[xX]%x+]]', format("%q", coroutine.create(function() end))) end); end); @@ -880,8 +880,8 @@ describe("util.format", function() describe("to %q", function () it("works", function () - assert.matches("{ }", format("%q", { })) - assert.equal("{ }", format("%q", setmetatable({},{__tostring=function ()return "foo \1\2\3 bar"end}))) + assert.matches("{}", format("%q", { })) + assert.equal("{}", format("%q", setmetatable({},{__tostring=function ()return "foo \1\2\3 bar"end}))) end); end); |