summaryrefslogtreecommitdiff
path: root/specs/comments.json
diff options
context:
space:
mode:
Diffstat (limited to 'specs/comments.json')
-rw-r--r--specs/comments.json95
1 files changed, 94 insertions, 1 deletions
diff --git a/specs/comments.json b/specs/comments.json
index 30cb927..60a4929 100644
--- a/specs/comments.json
+++ b/specs/comments.json
@@ -1 +1,94 @@
-{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Comment tags represent content that should never appear in the resulting\noutput.\n\nThe tag's content may contain any substring (including newlines) EXCEPT the\nclosing delimiter.\n\nComment tags SHOULD be treated as standalone when appropriate.\n","tests":[{"name":"Inline","data":{},"expected":"1234567890","template":"12345{{! Comment Block! }}67890","desc":"Comment blocks should be removed from the template."},{"name":"Multiline","data":{},"expected":"1234567890\n","template":"12345{{!\n This is a\n multi-line comment...\n}}67890\n","desc":"Multiline comments should be permitted."},{"name":"Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n{{! Comment Block! }}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Indented Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n {{! Indented Comment Block! }}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Standalone Line Endings","data":{},"expected":"|\r\n|","template":"|\r\n{{! Standalone Comment }}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","data":{},"expected":"!","template":" {{! I'm Still Standalone }}\n!","desc":"Standalone tags should not require a newline to precede them."},{"name":"Standalone Without Newline","data":{},"expected":"!\n","template":"!\n {{! I'm Still Standalone }}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Multiline Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n{{!\nSomething's going on here...\n}}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Indented Multiline Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n {{!\n Something's going on here...\n }}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Indented Inline","data":{},"expected":" 12 \n","template":" 12 {{! 34 }}\n","desc":"Inline comments should not strip whitespace"},{"name":"Surrounding Whitespace","data":{},"expected":"12345 67890","template":"12345 {{! Comment Block! }} 67890","desc":"Comment removal should preserve surrounding whitespace."}]} \ No newline at end of file
+{
+ "__ATTN__": "Do not edit this file; changes belong in the appropriate YAML file.",
+ "overview": "Comment tags represent content that should never appear in the resulting\noutput.\n\nThe tag's content may contain any substring (including newlines) EXCEPT the\nclosing delimiter.\n\nComment tags SHOULD be treated as standalone when appropriate.\n",
+ "tests": [
+ {
+ "name": "Inline",
+ "desc": "Comment blocks should be removed from the template.",
+ "data": {
+ },
+ "template": "12345{{! Comment Block! }}67890",
+ "expected": "1234567890"
+ },
+ {
+ "name": "Multiline",
+ "desc": "Multiline comments should be permitted.",
+ "data": {
+ },
+ "template": "12345{{!\n This is a\n multi-line comment...\n}}67890\n",
+ "expected": "1234567890\n"
+ },
+ {
+ "name": "Standalone",
+ "desc": "All standalone comment lines should be removed.",
+ "data": {
+ },
+ "template": "Begin.\n{{! Comment Block! }}\nEnd.\n",
+ "expected": "Begin.\nEnd.\n"
+ },
+ {
+ "name": "Indented Standalone",
+ "desc": "All standalone comment lines should be removed.",
+ "data": {
+ },
+ "template": "Begin.\n {{! Indented Comment Block! }}\nEnd.\n",
+ "expected": "Begin.\nEnd.\n"
+ },
+ {
+ "name": "Standalone Line Endings",
+ "desc": "\"\\r\\n\" should be considered a newline for standalone tags.",
+ "data": {
+ },
+ "template": "|\r\n{{! Standalone Comment }}\r\n|",
+ "expected": "|\r\n|"
+ },
+ {
+ "name": "Standalone Without Previous Line",
+ "desc": "Standalone tags should not require a newline to precede them.",
+ "data": {
+ },
+ "template": " {{! I'm Still Standalone }}\n!",
+ "expected": "!"
+ },
+ {
+ "name": "Standalone Without Newline",
+ "desc": "Standalone tags should not require a newline to follow them.",
+ "data": {
+ },
+ "template": "!\n {{! I'm Still Standalone }}",
+ "expected": "!\n"
+ },
+ {
+ "name": "Multiline Standalone",
+ "desc": "All standalone comment lines should be removed.",
+ "data": {
+ },
+ "template": "Begin.\n{{!\nSomething's going on here...\n}}\nEnd.\n",
+ "expected": "Begin.\nEnd.\n"
+ },
+ {
+ "name": "Indented Multiline Standalone",
+ "desc": "All standalone comment lines should be removed.",
+ "data": {
+ },
+ "template": "Begin.\n {{!\n Something's going on here...\n }}\nEnd.\n",
+ "expected": "Begin.\nEnd.\n"
+ },
+ {
+ "name": "Indented Inline",
+ "desc": "Inline comments should not strip whitespace",
+ "data": {
+ },
+ "template": " 12 {{! 34 }}\n",
+ "expected": " 12 \n"
+ },
+ {
+ "name": "Surrounding Whitespace",
+ "desc": "Comment removal should preserve surrounding whitespace.",
+ "data": {
+ },
+ "template": "12345 {{! Comment Block! }} 67890",
+ "expected": "12345 67890"
+ }
+ ]
+}