mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Remove unneeded _.memoize.Cache test.
This commit is contained in:
18
test/test.js
18
test/test.js
@@ -12388,7 +12388,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('should allow `_.memoize.Cache` to be customized', function(assert) {
|
QUnit.test('should allow `_.memoize.Cache` to be customized', function(assert) {
|
||||||
assert.expect(5);
|
assert.expect(4);
|
||||||
|
|
||||||
var oldCache = _.memoize.Cache;
|
var oldCache = _.memoize.Cache;
|
||||||
|
|
||||||
@@ -12397,19 +12397,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Cache.prototype = {
|
Cache.prototype = {
|
||||||
'delete': function(key) {
|
|
||||||
var data = this.__data__;
|
|
||||||
|
|
||||||
var index = _.findIndex(data, function(entry) {
|
|
||||||
return key === entry.key;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (index < 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
data.splice(index, 1);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
'get': function(key) {
|
'get': function(key) {
|
||||||
var entry = _.find(this.__data__, function(entry) {
|
var entry = _.find(this.__data__, function(entry) {
|
||||||
return key === entry.key;
|
return key === entry.key;
|
||||||
@@ -12443,9 +12430,6 @@
|
|||||||
assert.strictEqual(memoized(key2), 'value:b');
|
assert.strictEqual(memoized(key2), 'value:b');
|
||||||
assert.strictEqual(cache.has(key2), true);
|
assert.strictEqual(cache.has(key2), true);
|
||||||
|
|
||||||
cache['delete'](key2);
|
|
||||||
assert.strictEqual(cache.has(key2), false);
|
|
||||||
|
|
||||||
_.memoize.Cache = oldCache;
|
_.memoize.Cache = oldCache;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user