summaryrefslogtreecommitdiff
path: root/Data/Libraries/Penlight/spec/text_spec.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-30 11:32:16 +0800
committerchai <chaifix@163.com>2021-10-30 11:32:16 +0800
commit42ec7286b2d36a9ba22925f816a17cb1cc2aa5ce (patch)
tree24bc7009457a8d7500f264e89946dc20d069294f /Data/Libraries/Penlight/spec/text_spec.lua
parent164885fd98d48703bd771f802d79557b7db97431 (diff)
+ Penlight
Diffstat (limited to 'Data/Libraries/Penlight/spec/text_spec.lua')
-rw-r--r--Data/Libraries/Penlight/spec/text_spec.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/Data/Libraries/Penlight/spec/text_spec.lua b/Data/Libraries/Penlight/spec/text_spec.lua
new file mode 100644
index 0000000..cd42f06
--- /dev/null
+++ b/Data/Libraries/Penlight/spec/text_spec.lua
@@ -0,0 +1,11 @@
+local text = require("pl.text")
+
+describe("pl.text.Template", function ()
+
+ it("replaces placeholders", function ()
+ local tempalte = text.Template("${here} is the $answer")
+ local out = tempalte:substitute({ here = 'one', answer = 'two' })
+ assert.is.equal('one is the two', out)
+ end)
+
+end)