mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Add _.escape and _.unescape tests for backticks.
This commit is contained in:
28
test/test.js
28
test/test.js
@@ -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);
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user