Skip to content

Commit

Permalink
Added failing test for quotes in statements with regex-significant ch…
Browse files Browse the repository at this point in the history
…aracters in tokens
  • Loading branch information
rfletcher committed Feb 24, 2010
1 parent 625adb8 commit 38a8259
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/utility.js
Expand Up @@ -42,6 +42,9 @@ $(document).ready(function() {
var quoteTemplate = _.template("It's its, not it's");
equals(quoteTemplate({}), "It's its, not it's");

var quoteInStatementAndBody = _.template("<% if(foo == 'bar'){ %>Statement quotes and 'quotes'.<% } %>");
equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'.");

_.templateSettings = {
start : '{{',
end : '}}',
Expand All @@ -55,6 +58,9 @@ $(document).ready(function() {
var customQuote = _.template("It's its, not it's");
equals(customQuote({}), "It's its, not it's");

var quoteInStatementAndBody = _.template("{{ if(foo == 'bar'){ }}Statement quotes and 'quotes'.{{ } }}");
equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'.");

_.templateSettings = {
start : '<?',
end : '?>',
Expand All @@ -68,6 +74,9 @@ $(document).ready(function() {
var customWithSpecialCharsQuote = _.template("It's its, not it's");
equals(customWithSpecialCharsQuote({}), "It's its, not it's");

var quoteInStatementAndBody = _.template("<? if(foo == 'bar'){ ?>Statement quotes and 'quotes'.<? } ?>");
equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'.");

_.templateSettings = {
start : '{{',
end : '}}',
Expand Down

0 comments on commit 38a8259

Please sign in to comment.