Actually implemented delimiter change. Tidied things upalong the way.

This commit is contained in:
Michael Bayne
2011-04-13 15:42:28 -07:00
parent f34539850a
commit 6b1551a1c9
2 changed files with 76 additions and 19 deletions
@@ -134,6 +134,13 @@ public class MustacheTest
}), "foo inside:foo nonfoo foo", "{{bar}} {{>foo}} {{>baz}} {{bar}}", context("bar", "foo"));
}
@Test public void testDelimiterChange () {
test("foo bar baz", "{{one}} {{=<% %>=}}<%two%><%={{ }}=%> {{three}}",
context("one", "foo", "two", "bar", "three", "baz"));
test("baz bar foo", "{{three}} {{=% %=}}%two%%={{ }}=% {{one}}",
context("one", "foo", "two", "bar", "three", "baz"));
}
@Test public void testUnescapeHTML () {
assertEquals("<b>", Mustache.compiler().escapeHTML(true).compile("{{&a}}").
execute(context("a", "<b>")));