diff options
author | Kim Alvefur <zash@zash.se> | 2019-10-20 20:56:29 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-10-20 20:56:29 +0200 |
commit | c313d534b114a35d62bab1021c306d37fa496688 (patch) | |
tree | bda9f06804e182f951dc9860787e6a802569654a | |
parent | 5015900f911d7c237f5fa04c00e7e821f5575748 (diff) | |
download | prosody-c313d534b114a35d62bab1021c306d37fa496688.tar.gz prosody-c313d534b114a35d62bab1021c306d37fa496688.zip |
util.interpolation: Test array syntax
-rw-r--r-- | spec/util_interpolation_spec.lua | 8 |
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); |