aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_format_spec.lua
blob: 7e6a0c6ee01e7e015b5e2f9d5b391488d0be7f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local format = require "util.format".format;

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("", nil));
			assert.equal("true", format("%s", true));
			assert.equal("[true]", format("%d", true));
			assert.equal("% [true]", format("%%", true));
		end);
	end);
end);