mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Add map cache test for changing values.
This commit is contained in:
16
test/test.js
16
test/test.js
@@ -1036,8 +1036,8 @@
|
|||||||
'large stacks': largeStack
|
'large stacks': largeStack
|
||||||
};
|
};
|
||||||
|
|
||||||
lodashStable.forOwn(caches, function(cache, key) {
|
lodashStable.forOwn(caches, function(cache, kind) {
|
||||||
QUnit.test('should implement a `Map` interface for ' + key, function(assert) {
|
QUnit.test('should implement a `Map` interface for ' + kind, function(assert) {
|
||||||
assert.expect(82);
|
assert.expect(82);
|
||||||
|
|
||||||
lodashStable.each(keys, function(key, index) {
|
lodashStable.each(keys, function(key, index) {
|
||||||
@@ -1058,6 +1058,18 @@
|
|||||||
return !cache.has(key);
|
return !cache.has(key);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test('should support changing values of ' + kind, function(assert) {
|
||||||
|
assert.expect(10);
|
||||||
|
|
||||||
|
lodashStable.each(keys, function(key) {
|
||||||
|
cache.set(key, 1);
|
||||||
|
cache.set(key, 2);
|
||||||
|
|
||||||
|
assert.strictEqual(cache.get(key), 2);
|
||||||
|
cache.clear();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user