Added failing test for quotes in statements with regex-significant characters in tokens

This commit is contained in:
Rick Fletcher
2010-02-23 23:44:25 -08:00
parent 625adb81a3
commit 38a82591b1

View File

@@ -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 : '}}',
@@ -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 : '?>',
@@ -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 : '}}',