spec/util_format_spec.lua
author Kim Alvefur <zash@zash.se>
Thu, 22 Jul 2021 17:18:39 +0200
branch0.11
changeset 11716 d117b92fd8e4
parent 8623 84b73949fc30
child 9660 3da6cc927ee6
permissions -rw-r--r--
MUC: Fix logic for access to affiliation lists Fixes https://prosody.im/security/advisory_20210722/ Backs out 4d7b925652d9

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);