util.format: Change formatting of nil values to avoid looking like XML

This commit is contained in:
Kim Alvefur 2021-06-29 16:18:31 +02:00
parent bfb4514d0f
commit 6e037dc045
2 changed files with 6 additions and 6 deletions

View file

@ -4,10 +4,10 @@ describe("util.format", function()
describe("#format()", function()
it("should work", function()
assert.equal("hello", format("%s", "hello"));
assert.equal("<nil>", format("%s"));
assert.equal("<nil>", format("%d"));
assert.equal("<nil>", format("%q"));
assert.equal(" [<nil>]", format("", nil));
assert.equal("(nil)", format("%s"));
assert.equal("(nil)", format("%d"));
assert.equal("(nil)", format("%q"));
assert.equal(" [(nil)]", format("", nil));
assert.equal("true", format("%s", true));
assert.equal("[true]", format("%d", true));
assert.equal("% [true]", format("%%", true));