aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-20 20:56:29 +0200
committerKim Alvefur <zash@zash.se>2019-10-20 20:56:29 +0200
commitc0a72783661d8008519a0283ac7f107661f89c6b (patch)
treebda9f06804e182f951dc9860787e6a802569654a /spec
parent8b19b4435f6feded2bfffa4ee5a11716579ec7ea (diff)
downloadprosody-c0a72783661d8008519a0283ac7f107661f89c6b.tar.gz
prosody-c0a72783661d8008519a0283ac7f107661f89c6b.zip
util.interpolation: Test array syntax
Diffstat (limited to 'spec')
-rw-r--r--spec/util_interpolation_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/util_interpolation_spec.lua b/spec/util_interpolation_spec.lua
index 9fcad469..4106e10b 100644
--- a/spec/util_interpolation_spec.lua
+++ b/spec/util_interpolation_spec.lua
@@ -10,6 +10,13 @@ Hello, world!
local expect3 = [[
Hi, YOU!
]];
+local template_array = [[
+{foo#{idx}. {item}
+}]]
+local expect_array = [[
+1. HELLO
+2. WORLD
+]]
describe("util.interpolation", function ()
it("renders", function ()
@@ -17,5 +24,6 @@ describe("util.interpolation", function ()
assert.equal(expect1, render(template, { greet = "Hello", name = "world" }));
assert.equal(expect2, render(template, { greet = "Hello" }));
assert.equal(expect3, render(template, { name = "you" }));
+ assert.equal(expect_array, render(template_array, { foo = { "Hello", "World" } }));
end);
end);