aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_interpolation_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-25 21:27:05 +0100
committerKim Alvefur <zash@zash.se>2021-01-25 21:27:05 +0100
commite91db8d93543bf2a3a4ba2bff73ef8be55e029eb (patch)
treeed7bd36fbc8d1df5c31be26f1215981eab5a4d88 /spec/util_interpolation_spec.lua
parent414c232247ed65376811937ee00da1d29c0353b4 (diff)
downloadprosody-e91db8d93543bf2a3a4ba2bff73ef8be55e029eb.tar.gz
prosody-e91db8d93543bf2a3a4ba2bff73ef8be55e029eb.zip
util.interpolation: Add test for #1623
Diffstat (limited to 'spec/util_interpolation_spec.lua')
-rw-r--r--spec/util_interpolation_spec.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/util_interpolation_spec.lua b/spec/util_interpolation_spec.lua
index 614d1f54..1d6d22c7 100644
--- a/spec/util_interpolation_spec.lua
+++ b/spec/util_interpolation_spec.lua
@@ -58,4 +58,9 @@ describe("util.interpolation", function ()
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);