Skip to content

Commit

Permalink
More mailing tests for #46
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Mar 7, 2013
1 parent 37128e4 commit f6a4294
Showing 1 changed file with 78 additions and 48 deletions.
126 changes: 78 additions & 48 deletions src/tests/Public/v6.0/GRMustacheSuites/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,6 @@
"template": "<{{subject}}>",
"expected": "<--- >"
},
{
"name": "Lines containing a single empty variable tag are not rendered.",
"data": { "present": "---" },
"template": "{{present}}\n{{missing}}",
"expected": "---\n"
},
{
"name": "Lines containing a single empty variable tag are not rendered.",
"data": { },
"template": "---\n{{missing}}",
"expected": "---\n"
},
{
"name": "Lines containing a single empty variable tag are not rendered.",
"data": { "present": "---" },
Expand Down Expand Up @@ -178,18 +166,6 @@
"template": "---\n{{missing}}\n{{missing}}\n---\n{{missing}}\n---\n",
"expected": "---\n---\n---\n"
},
{
"name": "Lines containing a single empty variable tag prefixed by white space are not rendered.",
"data": { "present": "---" },
"template": " {{present}}\n {{missing}}",
"expected": " ---\n"
},
{
"name": "Lines containing a single empty variable tag prefixed by white space are not rendered.",
"data": { },
"template": " ---\n {{missing}}",
"expected": " ---\n"
},
{
"name": "Lines containing a single empty variable tag prefixed by white space are not rendered.",
"data": { "present": "---" },
Expand Down Expand Up @@ -238,18 +214,6 @@
"template": " ---\n {{missing}}\n {{missing}}\n {{missing}}\n ---\n {{missing}}\n ---\n",
"expected": " ---\n ---\n ---\n"
},
{
"name": "Lines containing a single empty variable tag followed by white space are not rendered.",
"data": { "present": "---" },
"template": "{{present}} \n{{missing}} ",
"expected": "--- \n"
},
{
"name": "Lines containing a single empty variable tag followed by white space are not rendered.",
"data": { },
"template": "--- \n{{missing}} ",
"expected": "--- \n"
},
{
"name": "Lines containing a single empty variable tag followed by white space are not rendered.",
"data": { "present": "---" },
Expand Down Expand Up @@ -298,18 +262,6 @@
"template": "--- \n{{missing}} \n{{missing}} \n{{missing}} \n--- \n{{missing}} \n--- \n",
"expected": "--- \n--- \n--- \n"
},
{
"name": "Lines containing a single empty variable tag surrounded by white space are not rendered.",
"data": { "present": "---" },
"template": " {{present}} \n {{missing}} ",
"expected": " --- \n"
},
{
"name": "Lines containing a single empty variable tag surrounded by white space are not rendered.",
"data": { },
"template": " --- \n {{missing}} ",
"expected": " --- \n"
},
{
"name": "Lines containing a single empty variable tag surrounded by white space are not rendered.",
"data": { "present": "---" },
Expand Down Expand Up @@ -358,6 +310,42 @@
"template": " --- \n {{missing}} \n {{missing}} \n {{missing}} \n --- \n {{missing}} \n --- \n",
"expected": " --- \n --- \n --- \n"
},
{
"name": "Lines containing a single empty variable tag prefixed by white space are rendered if they don't end with a new line.",
"data": { "present": "---" },
"template": " {{present}}\n {{missing}}",
"expected": " ---\n "
},
{
"name": "Lines containing a single empty variable tag prefixed by white space are rendered if they don't end with a new line.",
"data": { },
"template": " ---\n {{missing}}",
"expected": " ---\n "
},
{
"name": "Lines containing a single empty variable tag followed by white space are rendered if they don't end with a new line.",
"data": { "present": "---" },
"template": "{{present}} \n{{missing}} ",
"expected": "--- \n "
},
{
"name": "Lines containing a single empty variable tag followed by white space are rendered if they don't end with a new line.",
"data": { },
"template": "--- \n{{missing}} ",
"expected": "--- \n "
},
{
"name": "Lines containing a single empty variable tag surrounded by white space are rendered if they don't end with a new line.",
"data": { "present": "---" },
"template": " {{present}} \n {{missing}} ",
"expected": " --- \n "
},
{
"name": "Lines containing a single empty variable tag surrounded by white space are rendered if they don't end with a new line.",
"data": { },
"template": " --- \n {{missing}} ",
"expected": " --- \n "
},
{
// first failing example from https://github.com/groue/GRMustache/issues/46#issuecomment-14354838
"name": "Prefixes of skipped lines do not pollute surrounding lines",
Expand All @@ -371,6 +359,48 @@
"data": { "present": "---" },
"template": "{{missing}}\n...{{present}}...\n{{missing}}\n...{{present}}...\n{{missing}}\n",
"expected": "...---...\n...---...\n"
},
{
"name": "Blank line with several empty tags do not render",
"data": { },
"template": "{{missing}} {{missing}}\n",
"expected": ""
},
{
"name": "TODO",
"data": { "present": "---" },
"template": " {{missing}} {{present}}\n",
"expected": " ---\n"
},
{
"name": "TODO",
"data": { "present": "---" },
"template": " {{missing}}{{present}}\n",
"expected": " ---\n"
},
{
"name": "TODO",
"data": { "present": "---" },
"template": "{{missing}}{{present}}\n",
"expected": "---\n"
},
{
"name": "TODO",
"data": { "present": "---" },
"template": " {{missing}} {{present}}",
"expected": " ---"
},
{
"name": "TODO",
"data": { "present": "---" },
"template": " {{missing}}{{present}}",
"expected": " ---"
},
{
"name": "TODO",
"data": { "present": "---" },
"template": "{{missing}}{{present}}",
"expected": "---"
}
]
}

0 comments on commit f6a4294

Please sign in to comment.