aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-20 20:58:19 +0200
committerKim Alvefur <zash@zash.se>2019-10-20 20:58:19 +0200
commit37a97e23ac9636177c989f90c97d2708da21ae0a (patch)
treebe91661b5739743e2ee49c5c464af219e7e6ceed
parentc313d534b114a35d62bab1021c306d37fa496688 (diff)
downloadprosody-37a97e23ac9636177c989f90c97d2708da21ae0a.tar.gz
prosody-37a97e23ac9636177c989f90c97d2708da21ae0a.zip
util.interpolation: Test map syntax
-rw-r--r--spec/util_interpolation_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/util_interpolation_spec.lua b/spec/util_interpolation_spec.lua
index 4106e10b..eb49e53b 100644
--- a/spec/util_interpolation_spec.lua
+++ b/spec/util_interpolation_spec.lua
@@ -17,6 +17,12 @@ local expect_array = [[
1. HELLO
2. WORLD
]]
+local template_map = [[
+{foo%{idx}: {item!}
+}]]
+local expect_map = [[
+FOO: bar
+]]
describe("util.interpolation", function ()
it("renders", function ()
@@ -25,5 +31,6 @@ describe("util.interpolation", function ()
assert.equal(expect2, render(template, { greet = "Hello" }));
assert.equal(expect3, render(template, { name = "you" }));
assert.equal(expect_array, render(template_array, { foo = { "Hello", "World" } }));
+ assert.equal(expect_map, render(template_map, { foo = { foo = "bar" } }));
end);
end);