Skip to content

Commit

Permalink
adding a test for #666
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Aug 31, 2012
1 parent a4a2e03 commit b24a1c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ $(document).ready(function() {
strictEqual(tmpl(), '<p>\u2028\u2028\u2029\u2029</p>');
});

test('utility: template gives you the body of the template on SyntaxError', function() {
var template = '<b><%= if %></b>';
try {
_.template(template);
} catch(e) {
equal(e.template, template);
}
});

test('result calls functions and returns primitives', function() {
var obj = {w: '', x: 'x', y: function(){ return this.x; }};
strictEqual(_.result(obj, 'w'), '');
Expand Down

0 comments on commit b24a1c2

Please sign in to comment.