From 483bc9ad872b8f0cfc338ce03c73e9d3ec1fe9cc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 17 Sep 2012 23:45:14 -0700 Subject: [PATCH] Add unit test to confirm correctly parsing delimiters. Former-commit-id: 71aa7a240d2becb8082e36f9aa4874eb0aed09d3 --- test/test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test.js b/test/test.js index f9010ca8b..c80554dee 100644 --- a/test/test.js +++ b/test/test.js @@ -1479,6 +1479,13 @@ var compiled = _.template('<%= value ? value : "b" %>'); equal(compiled({ 'value': 'a' }), 'a'); }); + + test('should parse delimiters with newlines correctly', function() { + var expected = '<<\nprint("

" + (value ? "yes" : "no") + "

")\n>>', + compiled = _.template(expected, null, { 'evaluate': /<<(.+?)>>/g }); + + equal(compiled({ 'value': true }), expected); + }); }()); /*--------------------------------------------------------------------------*/