mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 20:37:48 +00:00
Update vendors.
Former-commit-id: 88e9746e94e8ec899227b1a925bea4ab4d373fb0
This commit is contained in:
17
vendor/underscore/test/utility.js
vendored
17
vendor/underscore/test/utility.js
vendored
@@ -48,6 +48,15 @@ $(document).ready(function() {
|
||||
test("utility: _.escape", function() {
|
||||
equal(_.escape("Curly & Moe"), "Curly & Moe");
|
||||
equal(_.escape("Curly & Moe"), "Curly & Moe");
|
||||
equal(_.escape(null), '');
|
||||
});
|
||||
|
||||
test("utility: _.unescape", function() {
|
||||
var string = "Curly & Moe";
|
||||
equal(_.unescape("Curly & Moe"), string);
|
||||
equal(_.unescape("Curly & Moe"), "Curly & Moe");
|
||||
equal(_.unescape(null), '');
|
||||
equal(_.unescape(_.escape(string)), string);
|
||||
});
|
||||
|
||||
test("utility: template", function() {
|
||||
@@ -156,6 +165,14 @@ $(document).ready(function() {
|
||||
equal(templateWithNull({planet : "world"}), "a null undefined world", "can handle missing escape and evaluate settings");
|
||||
});
|
||||
|
||||
test('utility: _.template provides the generated function source, when a SyntaxError occurs', function() {
|
||||
try {
|
||||
_.template('<b><%= if %></b>');
|
||||
} catch (e) {
|
||||
ok(e.source.indexOf('( if )') > 0);
|
||||
}
|
||||
});
|
||||
|
||||
test('_.template handles \\u2028 & \\u2029', function() {
|
||||
var tmpl = _.template('<p>\u2028<%= "\\u2028\\u2029" %>\u2029</p>');
|
||||
strictEqual(tmpl(), '<p>\u2028\u2028\u2029\u2029</p>');
|
||||
|
||||
Reference in New Issue
Block a user