Changeset

11308:5d4d90d1eabb

util.interpolation: Add test for #1623
author Kim Alvefur <zash@zash.se>
date Mon, 25 Jan 2021 21:27:05 +0100
parents 11307:f2e276bb4ef8
children 11309:b59aed75dc5e
files spec/util_interpolation_spec.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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);