def test_explicit_evict(): d = dict() lru = LRU(10, d) lru['x'] = 1 lru['y'] = 2 assert set(d) == {'x', 'y'} lru.evict() assert set(d) == {'y'}
def test_explicit_evict(): d = dict() lru = LRU(10, d) lru["x"] = 1 lru["y"] = 2 assert set(d) == {"x", "y"} k, v, w = lru.evict() assert set(d) == {"y"} assert k == "x" assert v == 1 assert w == 1
def test_explicit_evict(): d = dict() lru = LRU(10, d) lru['x'] = 1 lru['y'] = 2 assert set(d) == {'x', 'y'} k, v, w = lru.evict() assert set(d) == {'y'} assert k == 'x' assert v == 1 assert w == 1