# HG changeset patch # User Kim Alvefur # Date 1520708321 -3600 # Node ID 3d6f5b20cca6c04c8619e05cb39a409e0dbcf24b # Parent a5ae3f4e1a402e2004b386e207df56c93d1eb6b9 spec: Stub tests for util.interpolation diff -r a5ae3f4e1a40 -r 3d6f5b20cca6 spec/util_interpolation_spec.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/util_interpolation_spec.lua Sat Mar 10 19:58:41 2018 +0100 @@ -0,0 +1,17 @@ +local template = [[ +{greet!}, {name?world}! +]]; +local expect1 = [[ +Hello, WORLD! +]]; +local expect2 = [[ +Hello, world! +]]; + +describe("util.interpolation", function () + it("renders", function () + local render = require "util.interpolation".new("%b{}", string.upper); + assert.equal(expect1, render(template, { greet = "Hello", name = "world" })); + assert.equal(expect2, render(template, { greet = "Hello" })); + end); +end);