Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

1 lines (1 sloc) 3.236 kb
{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"\nLoop tags are used to loop over an array, without lambda evaluation\nor testing for truthyness or pushing new hash context frames (hashes\nin the array however are pushed).\n\nLoop tags SHOULD be treated as standalone when\nappropriate.\n","tests":[{"name":"Loop over an empty array","data":{"array":[]},"expected":"","template":"{{,array}}This should not be rendered.{{/array}}","desc":"Loop over an empty array should not evaluate contents"},{"name":"Loop immediate","data":{"array":[1,2,3]},"expected":"1 2 3 ","template":"{{,array}}{{.}} {{/array}}","desc":"Loop over an array with immediate values"},{"name":"Loop hash","data":{"array":[{"item":1},{"item":2},{"item":3}]},"expected":"1 2 3 ","template":"{{,array}}{{item}} {{/array}}","desc":"Loop over an array with hashes"},{"name":"Loop single","data":{"a":"first","array":{"a":1,"b":2,"c":3}},"expected":"first first first ","template":"{{,array}}{{a}} {{/array}}","desc":"Loop over a hash should not push a new context"},{"name":"Nested loops single","data":{"a":"first","array":{"a":1,"b":2,"c":3}},"expected":"first first first ","template":"{{,array}}{{a}} {{/array}}","desc":"Loop over a hash should not push a new context"},{"name":"Context Misses","data":{},"expected":"","template":"{{,missing}}foobar{{/missing}}","desc":"Context misses should be considered as an empty array"},{"name":"Surrounding Whitespace","data":{"array":[1]},"expected":" | \t|\t | \n","template":" | {{,array}}\t|\t{{/array}} | \n","desc":"Loops should not alter surrounding whitespace."},{"name":"Internal Whitespace","data":{"array":[1]},"expected":" | \n | \n","template":" | {{,array}} {{! Important Whitespace }}\n {{/array}} | \n","desc":"Loops should not alter internal whitespace."},{"name":"Indented Inline Sections","data":{"array":[1]},"expected":" YES\n GOOD\n","template":" {{,array}}YES{{/array}}\n {{,array}}GOOD{{/array}}\n","desc":"Single-line Loops should not alter surrounding whitespace."},{"name":"Standalone Lines","data":{"array":[1]},"expected":"| This Is\n|\n| A Line\n","template":"| This Is\n{{,array}}\n|\n{{/array}}\n| A Line\n","desc":"Standalone lines should be removed from the template."},{"name":"Indented Standalone Lines","data":{"array":[1]},"expected":"| This Is\n|\n| A Line\n","template":"| This Is\n {{,array}}\n|\n {{/array}}\n| A Line\n","desc":"Indented standalone lines should be removed from the template."},{"name":"Standalone Line Endings","data":{"array":[1]},"expected":"|\r\n|","template":"|\r\n{{,array}}\r\n{{/array}}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","data":{"array":[1]},"expected":"#\n/","template":" {{,array}}\n#{{/array}}\n/","desc":"Standalone tags should not require a newline to precede them."},{"name":"Standalone Without Newline","data":{"array":[1]},"expected":"#\n/\n","template":"#{{,array}}\n/\n {{/array}}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Padding","data":{"array":[1]},"expected":"|=|","template":"|{{, array }}={{/ array }}|","desc":"Superfluous in-tag whitespace should be ignored."}]}
Jump to Line
Something went wrong with that request. Please try again.