summaryrefslogtreecommitdiff
path: root/specs/interpolation.json
diff options
context:
space:
mode:
authorJulian Gonggrijp <dev@juliangonggrijp.com>2021-04-19 02:00:26 +0200
committerJulian Gonggrijp <dev@juliangonggrijp.com>2021-04-19 02:00:26 +0200
commita2b4bec7397971d24db92ced09004b7ffc322e48 (patch)
tree60c039c50735b00644d39580043053c5ccf0b057 /specs/interpolation.json
parentb1329a25e6d265ff360267d23f7c6327bbf59f52 (diff)
downloadmustache-spec-a2b4bec7397971d24db92ced09004b7ffc322e48.tar.gz
Specify interpolation behavior for implicit iterator (#82)
Diffstat (limited to 'specs/interpolation.json')
-rw-r--r--specs/interpolation.json35
1 files changed, 35 insertions, 0 deletions
diff --git a/specs/interpolation.json b/specs/interpolation.json
index 1718e1c..170e00f 100644
--- a/specs/interpolation.json
+++ b/specs/interpolation.json
@@ -245,6 +245,41 @@
"expected": ""
},
{
+ "name": "Implicit Iterators - Basic Interpolation",
+ "desc": "Unadorned tags should interpolate content into the template.",
+ "data": "world",
+ "template": "Hello, {{.}}!\n",
+ "expected": "Hello, world!\n"
+ },
+ {
+ "name": "Implicit Iterators - HTML Escaping",
+ "desc": "Basic interpolation should be HTML escaped.",
+ "data": "& \" < >",
+ "template": "These characters should be HTML escaped: {{.}}\n",
+ "expected": "These characters should be HTML escaped: &amp; &quot; &lt; &gt;\n"
+ },
+ {
+ "name": "Implicit Iterators - Triple Mustache",
+ "desc": "Triple mustaches should interpolate without HTML escaping.",
+ "data": "& \" < >",
+ "template": "These characters should not be HTML escaped: {{{.}}}\n",
+ "expected": "These characters should not be HTML escaped: & \" < >\n"
+ },
+ {
+ "name": "Implicit Iterators - Ampersand",
+ "desc": "Ampersand should interpolate without HTML escaping.",
+ "data": "& \" < >",
+ "template": "These characters should not be HTML escaped: {{&.}}\n",
+ "expected": "These characters should not be HTML escaped: & \" < >\n"
+ },
+ {
+ "name": "Implicit Iterators - Basic Integer Interpolation",
+ "desc": "Integers should interpolate seamlessly.",
+ "data": 85,
+ "template": "\"{{.}} miles an hour!\"",
+ "expected": "\"85 miles an hour!\""
+ },
+ {
"name": "Interpolation - Surrounding Whitespace",
"desc": "Interpolation should not alter surrounding whitespace.",
"data": {