fn size_cache_racing_keys_eviction_regression() {
        let mut c = SizedCache::with_size(2);
        c.cache_set(1, 100);
        c.cache_set(1, 100);
        // size would be 1, but internal ordered would be [1, 1]
        c.cache_set(2, 100);
        c.cache_set(3, 100);
        // this next set would fail because a duplicate key would be evicted
        c.cache_set(4, 100);
    }
/// This is a regression test to confirm that racing cache sets on a SizedCache
/// do not cause duplicates to exist in the internal `order`. See issue #7
This is a regression test to confirm that racing cache sets on a SizedCache
do not cause duplicates to exist in the internal `order`. See issue #7
This is a regression test to confirm that racing cache sets on a SizedCache do not cause duplicates to exist in the internal ` order ` . See issue #7
fn size_cache_racing_keys_eviction_regression() {
        let mut c = SizedCache::with_size(2);
        c.cache_set(1, 100);
        c.cache_set(1, 100);
        // size would be 1, but internal ordered would be [1, 1]
        c.cache_set(2, 100);
        c.cache_set(3, 100);
        // this next set would fail because a duplicate key would be evicted
        c.cache_set(4, 100);
    }
fn size_cache_racing_keys_eviction_regression ( ) { let mut c = SizedCache :: with_size ( 2 ) ; c . cache_set ( 1 , 100 ) ; c . cache_set ( 1 , 100 ) ; // size would be 1, but internal ordered would be [1, 1] c . cache_set ( 2 , 100 ) ; c . cache_set ( 3 , 100 ) ; // this next set would fail because a duplicate key would be evicted c . cache_set ( 4 , 100 ) ; }
This is a regression test to confirm that racing cache sets on a SizedCache
do not cause duplicates to exist in the internal `order`.
This is a regression test to confirm that racing cache sets on a SizedCache do not cause duplicates to exist in the internal ` order ` .