Prosody IM trunk


changeset 5d4d90d1eabb

util.interpolation: Add test for #1623

author
Kim Alvefur
date
parents
children
files

1 files changed, 5 insertions(+), 0 deletions(-)

↓ Download patch

--- a/spec/util_interpolation_spec.lua	Mon Jan 25 21:26:45 2021 +0100
+++ b/spec/util_interpolation_spec.lua	Mon Jan 25 21:27:05 2021 +0100
@@ -58,4 +58,9 @@
 		assert.equal(expect_not_nil, render(template_not, { thing = nil }));
 		assert.equal(expect_not_false, render(template_not, { thing = false }));
 	end);
+	it("fixes #1623", function ()
+		local render = require "util.interpolation".new("%b{}", string.upper, { x = string.lower });
+		assert.equal("", render("{foo?}", {  }))
+		assert.equal("", render("{foo|x?}", {  }))
+	end);
 end);