Skip to content

Commit 66f078e

Browse files
committed
Merge branch 'add_test_for_dotted_keys' (PR #180)
2 parents 1b4ea6b + c0b03a9 commit 66f078e

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

specs/interpolation.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,27 @@
281281
"template": "{{#a}}{{b.c}}{{/a}}",
282282
"expected": ""
283283
},
284+
{
285+
"name": "Dotted Names are never single keys",
286+
"desc": "Dotted names shall not be parsed as single, atomic keys",
287+
"data": {
288+
"a.b": "c"
289+
},
290+
"template": "{{a.b}}",
291+
"expected": ""
292+
},
293+
{
294+
"name": "Dotted Names - No Masking",
295+
"desc": "Dotted Names in a given context are unvavailable due to dot splitting",
296+
"data": {
297+
"a.b": "c",
298+
"a": {
299+
"b": "d"
300+
}
301+
},
302+
"template": "{{a.b}}",
303+
"expected": "d"
304+
},
284305
{
285306
"name": "Implicit Iterators - Basic Interpolation",
286307
"desc": "Unadorned tags should interpolate content into the template.",

specs/interpolation.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ tests:
203203
template: '{{#a}}{{b.c}}{{/a}}'
204204
expected: ''
205205

206+
- name: Dotted Names are never single keys
207+
desc: Dotted names shall not be parsed as single, atomic keys
208+
data:
209+
a.b: c
210+
template: '{{a.b}}'
211+
expected: ''
212+
213+
- name: Dotted Names - No Masking
214+
desc: Dotted Names in a given context are unvavailable due to dot splitting
215+
data:
216+
a.b: c
217+
a: { b: d }
218+
template: '{{a.b}}'
219+
expected: 'd'
220+
206221
# Implicit Iterators
207222

208223
- name: Implicit Iterators - Basic Interpolation

0 commit comments

Comments
 (0)