1 local format = require
"util.format".format;
3 describe("util.format", function()
4 describe("#format()", function()
5 it("should work", function()
6 assert.equal("hello", format("%s", "hello"));
7 assert.equal("<nil>", format("%s"));
8 assert.equal("<nil>", format("%d"));
9 assert.equal("<nil>", format("%q"));
10 assert.equal(" [<nil>]", format("", nil));
11 assert.equal("true", format("%s", true));
12 assert.equal("[true]", format("%d", 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));