Comparison

spec/util_format_spec.lua @ 10046:0bc291a5734a

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 10 Jun 2019 13:22:22 +0200
parent 10035:386f085820e6
child 11638:5f4a657136bc
comparison
equal deleted inserted replaced
10045:6714578cfd6e 10046:0bc291a5734a
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);