Software /
code /
prosody
Diff
spec/util_interpolation_spec.lua @ 11308:5d4d90d1eabb
util.interpolation: Add test for #1623
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 25 Jan 2021 21:27:05 +0100 |
parent | 11065:95eb1a981ef6 |
line wrap: on
line diff
--- 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);