mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +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
|
||||
};
|
||||
|
||||
lodashStable.forOwn(caches, function(cache, key) {
|
||||
QUnit.test('should implement a `Map` interface for ' + key, function(assert) {
|
||||
lodashStable.forOwn(caches, function(cache, kind) {
|
||||
QUnit.test('should implement a `Map` interface for ' + kind, function(assert) {
|
||||
assert.expect(82);
|
||||
|
||||
lodashStable.each(keys, function(key, index) {
|
||||
@@ -1058,6 +1058,18 @@
|
||||
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