aboutsummaryrefslogtreecommitdiffstats
path: root/spec
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
commit800af648de857e5bb2d328d0325bb637d5a5a1f5 (patch)
treeed7bd36fbc8d1df5c31be26f1215981eab5a4d88 /spec
parent334aa4ad5c59e33ee986dd6e8b03561dc7684486 (diff)
downloadprosody-800af648de857e5bb2d328d0325bb637d5a5a1f5.tar.gz
prosody-800af648de857e5bb2d328d0325bb637d5a5a1f5.zip
util.interpolation: Add test for #1623
Diffstat (limited to 'spec')
-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);