From 45a786b4a8a75f0c8bdcafecb933c3286f3fc475 Mon Sep 17 00:00:00 2001 From: jverzani Date: Sun, 28 Jun 2015 08:57:32 -0400 Subject: [PATCH] unicode tests --- README.md | 8 +++++--- test/Mustache_test.jl | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f86cae8..e2e625f 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ As well, one can use Composite Kinds. This may make writing `show` methods easie ``` using Distributions -tpl = "Beta distribution with alpha={{alpha}}, beta={{beta}}" +tpl = "Beta distribution with alpha={{α}}, beta={{β}}" render(tpl, Beta(1, 2)) ``` @@ -130,8 +130,10 @@ variable is *not* defined. ### Iteration -If the section variable binds to an iterable collection, then the text -in the section is repeated for each item in the collection. +If the section variable, `{{#VARNAME}}`, binds to an iterable +collection, then the text in the section is repeated for each item in +the collection with the view used for the context of the template +given by the item. This is useful for collections of named objects, such as DataFrames (where the collection is comprised of rows) or arrays of diff --git a/test/Mustache_test.jl b/test/Mustache_test.jl index 7675f67..bf3bf89 100644 --- a/test/Mustache_test.jl +++ b/test/Mustache_test.jl @@ -34,3 +34,13 @@ tpl = "a:{{:a}} b:{{:b}}" ## keyword args @test render(tpl, a="ex", b="why") == "a:ex b:why" + +## unicode +module TMP +α = 1 +β = 2 +end +@test render("{{α}} + 1 = {{β}}", TMP) == "1 + 1 = 2" +@test render("{{:β}}", β=2) == "2" +@test render("α - {{:β}}", β=2) == "α - 2" +@test render("{{:α}}", α="β") == "β"