diff options
Diffstat (limited to 'specs/sections.yml')
-rw-r--r-- | specs/sections.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/specs/sections.yml b/specs/sections.yml index 5ce86a8..b7ed1d7 100644 --- a/specs/sections.yml +++ b/specs/sections.yml @@ -132,6 +132,29 @@ tests: template: "[{{#missing}}Found key 'missing'!{{/missing}}]" expected: "[]" + # Implicit Iterators + + - name: Implicit Iterator - String + desc: Implicit iterators should directly interpolate strings. + data: + list: [ 'a', 'b', 'c', 'd', 'e' ] + template: '"{{#list}}({{.}}){{/list}}"' + expected: '"(a)(b)(c)(d)(e)"' + + - name: Implicit Iterator - Integer + desc: Implicit iterators should cast integers to strings and interpolate. + data: + list: [ 1, 2, 3, 4, 5 ] + template: '"{{#list}}({{.}}){{/list}}"' + expected: '"(1)(2)(3)(4)(5)"' + + - name: Implicit Iterator - Decimal + desc: Implicit iterators should cast decimals to strings and interpolate. + data: + list: [ 1.10, 2.20, 3.30, 4.40, 5.50 ] + template: '"{{#list}}({{.}}){{/list}}"' + expected: '"(1.1)(2.2)(3.3)(4.4)(5.5)"' + # Whitespace Sensitivity - name: Surrounding Whitespace |