Add map cache test for changing values.

This commit is contained in:
John-David Dalton
2016-06-07 07:08:33 -07:00
parent 9992144130
commit ecbf8cd722

View File

@@ -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();
});
});
}); });
}()); }());