Software /
code /
prosody
Comparison
spec/util_format_spec.lua @ 10411:db2a06b9ff98
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 16 Nov 2019 16:52:31 +0100 (2019-11-16) |
parent | 10035:386f085820e6 |
child | 11638:5f4a657136bc |
comparison
equal
deleted
inserted
replaced
10410:659b577f280c | 10411:db2a06b9ff98 |
---|---|
3 describe("util.format", function() | 3 describe("util.format", function() |
4 describe("#format()", function() | 4 describe("#format()", function() |
5 it("should work", function() | 5 it("should work", function() |
6 assert.equal("hello", format("%s", "hello")); | 6 assert.equal("hello", format("%s", "hello")); |
7 assert.equal("<nil>", format("%s")); | 7 assert.equal("<nil>", format("%s")); |
8 assert.equal("<nil>", format("%d")); | |
9 assert.equal("<nil>", format("%q")); | |
8 assert.equal(" [<nil>]", format("", nil)); | 10 assert.equal(" [<nil>]", format("", nil)); |
9 assert.equal("true", format("%s", true)); | 11 assert.equal("true", format("%s", true)); |
10 assert.equal("[true]", format("%d", true)); | 12 assert.equal("[true]", format("%d", true)); |
11 assert.equal("% [true]", format("%%", true)); | 13 assert.equal("% [true]", format("%%", true)); |
14 assert.equal("{ }", format("%q", { })); | |
15 assert.equal("[1.5]", format("%d", 1.5)); | |
16 assert.equal("[7.3786976294838e+19]", format("%d", 73786976294838206464)); | |
12 end); | 17 end); |
13 end); | 18 end); |
14 end); | 19 end); |