aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_xtemplate_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-07-11 15:04:29 +0200
committerKim Alvefur <zash@zash.se>2024-07-11 15:04:29 +0200
commit8a96854733732892aba66cd153e74d24f5e6bf95 (patch)
tree41bba794f8d21f0b80710986bed7e32179df5703 /spec/util_xtemplate_spec.lua
parentb522fd0e05988adcef50c196be786591ac038c30 (diff)
downloadprosody-8a96854733732892aba66cd153e74d24f5e6bf95.tar.gz
prosody-8a96854733732892aba66cd153e74d24f5e6bf95.zip
util.xtemplate: Fix error on applying each() to zero stanzas
Diffstat (limited to 'spec/util_xtemplate_spec.lua')
-rw-r--r--spec/util_xtemplate_spec.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/util_xtemplate_spec.lua b/spec/util_xtemplate_spec.lua
index 4561378e..421be43f 100644
--- a/spec/util_xtemplate_spec.lua
+++ b/spec/util_xtemplate_spec.lua
@@ -38,6 +38,10 @@ describe("util.xtemplate", function ()
x:reset();
assert.same("12345", xtemplate.render("{foo/bar|each(i){{#}}}", x));
end)
+ it("handles missing inputs", function ()
+ local x = st.stanza("root");
+ assert.same("", xtemplate.render("{foo/bar|each(i){{#}}}", x));
+ end)
end)
end)
end)