File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88const EXAMPLE_FOR_TEMPLATE_3 = "{% for item in seq %} \n {{ item }} \n{%- endfor %} " ;
99const EXAMPLE_FOR_TEMPLATE_4 = "{% for item in seq -%} \n {{ item }} \n{%- endfor %} " ;
1010const EXAMPLE_COMMENT_TEMPLATE = " {# comment #} \n {# {% if true %} {% endif %} #} \n" ;
11+ const EXAMPLE_OBJECT_LITERAL_TEMPLATE = "{% set obj = { 'key1': 'value1', 'key2': 'value2' } %}{{ obj.key1 }} - {{ obj.key2 }} " ;
1112
1213dataset ('interpreterTestData ' , [
1314 // If tests
129130// 'trim_blocks' => true,
130131// 'target' => "",
131132// ],
133+
134+ // Object literal tests
135+ 'object literal (no strip or trim) ' => [
136+ 'template ' => EXAMPLE_OBJECT_LITERAL_TEMPLATE ,
137+ 'data ' => [],
138+ 'lstrip_blocks ' => false ,
139+ 'trim_blocks ' => false ,
140+ 'target ' => "value1 - value2 " ,
141+ ],
142+ 'object literal (strip and trim) ' => [
143+ 'template ' => EXAMPLE_OBJECT_LITERAL_TEMPLATE ,
144+ 'data ' => [],
145+ 'lstrip_blocks ' => true ,
146+ 'trim_blocks ' => true ,
147+ 'target ' => "value1 - value2 " ,
148+ ],
132149]);
You can’t perform that action at this time.
0 commit comments