Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: pkg/mustache/test/spec/inverted.json

Issue 804973002: Add appengine/gcloud/mustache dependencies. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang-dart.git@master
Patch Set: Added AUTHORS/LICENSE/PATENTS files Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/mustache/test/spec/interpolation.yml ('k') | pkg/mustache/test/spec/inverted.yml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 {"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file. ","overview":"Inverted Section tags and End Section tags are used in combination to wrap a\nsection of the template.\n\nThese tags' content MUST be a non-whites pace character sequence NOT\ncontaining the current closing delimiter; each Inve rted Section tag MUST be\nfollowed by an End Section tag with the same content w ithin the same\nsection.\n\nThis tag's content names the data to replace the tag . Name resolution is as\nfollows:\n 1) Split the name on periods; the first pa rt is the name to resolve, any\n remaining parts should be retained.\n 2) Walk the context stack from top to bottom, finding the first context\n that is a) a hash containing the name as a key OR b) an object responding\n to a method wit h the given name.\n 3) If the context is a hash, the data is the value associat ed with the\n name.\n 4) If the context is an object and the method with the g iven name has an\n arity of 1, the method SHOULD be called with a String contai ning the\n unprocessed contents of the sections; the data is the value returned .\n 5) Otherwise, the data is the value returned by calling the method with\n the given name.\n 6) If any name parts were retained in step 1, each should be resolved\n against a context stack containing only the result from the former\n resolution. If any part fails resolution, the result should be considered\n falsey, and should interpolate as the empty string.\nIf the data is not of a lis t type, it is coerced into a list as follows: if\nthe data is truthy (e.g. `!!da ta == true`), use a single-element list\ncontaining the data, otherwise use an e mpty list.\n\nThis section MUST NOT be rendered unless the data list is empty.\n \nInverted Section and End Section tags SHOULD be treated as standalone when\nap propriate.\n","tests":[{"name":"Falsey","data":{"boolean":false},"expected":"\"T his should be rendered.\"","template":"\"{{^boolean}}This should be rendered.{{/ boolean}}\"","desc":"Falsey sections should have their contents rendered."},{"na me":"Truthy","data":{"boolean":true},"expected":"\"\"","template":"\"{{^boolean} }This should not be rendered.{{/boolean}}\"","desc":"Truthy sections should have their contents omitted."},{"name":"Context","data":{"context":{"name":"Joe"}}," expected":"\"\"","template":"\"{{^context}}Hi {{name}}.{{/context}}\"","desc":"O bjects and hashes should behave like truthy values."},{"name":"List","data":{"li st":[{"n":1},{"n":2},{"n":3}]},"expected":"\"\"","template":"\"{{^list}}{{n}}{{/ list}}\"","desc":"Lists should behave like truthy values."},{"name":"Empty List" ,"data":{"list":[]},"expected":"\"Yay lists!\"","template":"\"{{^list}}Yay lists !{{/list}}\"","desc":"Empty lists should behave like falsey values."},{"name":"D oubled","data":{"two":"second","bool":false},"expected":"* first\n* second\n* th ird\n","template":"{{^bool}}\n* first\n{{/bool}}\n* {{two}}\n{{^bool}}\n* third\ n{{/bool}}\n","desc":"Multiple inverted sections per template should be permitte d."},{"name":"Nested (Falsey)","data":{"bool":false},"expected":"| A B C D E |", "template":"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |","desc":"Nested fa lsey sections should have their contents rendered."},{"name":"Nested (Truthy)"," data":{"bool":true},"expected":"| A E |","template":"| A {{^bool}}B {{^bool}}C{ {/bool}} D{{/bool}} E |","desc":"Nested truthy sections should be omitted."},{"n ame":"Context Misses","data":{},"expected":"[Cannot find key 'missing'!]","templ ate":"[{{^missing}}Cannot find key 'missing'!{{/missing}}]","desc":"Failed conte xt lookups should be considered falsey."},{"name":"Dotted Names - Truthy","data" :{"a":{"b":{"c":true}}},"expected":"\"\" == \"\"","template":"\"{{^a.b.c}}Not He re{{/a.b.c}}\" == \"\"","desc":"Dotted names should be valid for Inverted Sectio n tags."},{"name":"Dotted Names - Falsey","data":{"a":{"b":{"c":false}}},"expect ed":"\"Not Here\" == \"Not Here\"","template":"\"{{^a.b.c}}Not Here{{/a.b.c}}\" == \"Not Here\"","desc":"Dotted names should be valid for Inverted Section tags. "},{"name":"Dotted Names - Broken Chains","data":{"a":{}},"expected":"\"Not Here \" == \"Not Here\"","template":"\"{{^a.b.c}}Not Here{{/a.b.c}}\" == \"Not Here\" ","desc":"Dotted names that cannot be resolved should be considered falsey."},{" name":"Surrounding Whitespace","data":{"boolean":false},"expected":" | \t|\t | \ n","template":" | {{^boolean}}\t|\t{{/boolean}} | \n","desc":"Inverted sections should not alter surrounding whitespace."},{"name":"Internal Whitespace","data": {"boolean":false},"expected":" | \n | \n","template":" | {{^boolean}} {{! Impo rtant Whitespace }}\n {{/boolean}} | \n","desc":"Inverted should not alter inter nal whitespace."},{"name":"Indented Inline Sections","data":{"boolean":false},"e xpected":" NO\n WAY\n","template":" {{^boolean}}NO{{/boolean}}\n {{^boolean}}WAY {{/boolean}}\n","desc":"Single-line sections should not alter surrounding whites pace."},{"name":"Standalone Lines","data":{"boolean":false},"expected":"| This I s\n|\n| A Line\n","template":"| This Is\n{{^boolean}}\n|\n{{/boolean}}\n| A Line \n","desc":"Standalone lines should be removed from the template."},{"name":"Sta ndalone Indented Lines","data":{"boolean":false},"expected":"| This Is\n|\n| A L ine\n","template":"| This Is\n {{^boolean}}\n|\n {{/boolean}}\n| A Line\n","de sc":"Standalone indented lines should be removed from the template."},{"name":"S tandalone Line Endings","data":{"boolean":false},"expected":"|\r\n|","template": "|\r\n{{^boolean}}\r\n{{/boolean}}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","da ta":{"boolean":false},"expected":"^\n/","template":" {{^boolean}}\n^{{/boolean} }\n/","desc":"Standalone tags should not require a newline to precede them."},{" name":"Standalone Without Newline","data":{"boolean":false},"expected":"^\n/\n", "template":"^{{^boolean}}\n/\n {{/boolean}}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Padding","data":{"boolean":false}, "expected":"|=|","template":"|{{^ boolean }}={{/ boolean }}|","desc":"Superfluou s in-tag whitespace should be ignored."}]}
OLDNEW
« no previous file with comments | « pkg/mustache/test/spec/interpolation.yml ('k') | pkg/mustache/test/spec/inverted.yml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698