spec/util_format_spec.lua
author Kim Alvefur <zash@zash.se>
Mon, 12 Dec 2022 07:03:31 +0100
branch0.11
changeset 12802 c4b1b5cbc20b
parent 8623 84b73949fc30
child 9660 3da6cc927ee6
permissions -rw-r--r--
Tag 0.11.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);