mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Add unit test to confirm correctly parsing delimiters.
Former-commit-id: 71aa7a240d2becb8082e36f9aa4874eb0aed09d3
This commit is contained in:
@@ -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("<p>" + (value ? "yes" : "no") + "</p>")\n>>',
|
||||
compiled = _.template(expected, null, { 'evaluate': /<<(.+?)>>/g });
|
||||
|
||||
equal(compiled({ 'value': true }), expected);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user