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
commit9889cb8bb4c614939a4a82624b0e7e3539b80b63 (patch)
treebe91661b5739743e2ee49c5c464af219e7e6ceed
parentc0a72783661d8008519a0283ac7f107661f89c6b (diff)
downloadprosody-9889cb8bb4c614939a4a82624b0e7e3539b80b63.tar.gz
prosody-9889cb8bb4c614939a4a82624b0e7e3539b80b63.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);