Add _.escape and _.unescape tests for backticks.

This commit is contained in:
John-David Dalton
2016-09-20 07:49:40 -07:00
parent 1cc16029db
commit ec8e279235

View File

@@ -5464,12 +5464,6 @@
assert.strictEqual(_.escape(unescaped), escaped);
});
QUnit.test('should not escape the "/" character', function(assert) {
assert.expect(1);
assert.strictEqual(_.escape('/'), '/');
});
QUnit.test('should handle strings with nothing to escape', function(assert) {
assert.expect(1);
@@ -5481,6 +5475,14 @@
assert.strictEqual(_.escape(_.unescape(escaped)), escaped);
});
lodashStable.each(['`', '/'], function(chr) {
QUnit.test('should not escape the "' + chr + '" character', function(assert) {
assert.expect(1);
assert.strictEqual(_.escape(chr), chr);
});
});
}());
/*--------------------------------------------------------------------------*/
@@ -24244,12 +24246,6 @@
assert.strictEqual(_.unescape(escaped), unescaped);
});
QUnit.test('should not unescape the "/" entity', function(assert) {
assert.expect(1);
assert.strictEqual(_.unescape('/'), '/');
});
QUnit.test('should handle strings with nothing to unescape', function(assert) {
assert.expect(1);
@@ -24261,6 +24257,14 @@
assert.strictEqual(_.unescape(_.escape(unescaped)), unescaped);
});
lodashStable.each(['`', '/'], function(entity) {
QUnit.test('should not unescape the "' + entity + '" entity', function(assert) {
assert.expect(1);
assert.strictEqual(_.unescape(entity), entity);
});
});
}());
/*--------------------------------------------------------------------------*/