mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "common/lru: add test case for BasicLRU.Peek (#27559)"
This reverts commit 1fb3aa642e.
This commit is contained in:
parent
515c5b4b43
commit
b50ae251f8
1 changed files with 0 additions and 14 deletions
|
|
@ -170,20 +170,6 @@ func TestBasicLRUContains(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// Test that Peek doesn't update recent-ness
|
||||
func TestBasicLRUPeek(t *testing.T) {
|
||||
cache := NewBasicLRU[int, int](2)
|
||||
cache.Add(1, 1)
|
||||
cache.Add(2, 2)
|
||||
if v, ok := cache.Peek(1); !ok || v != 1 {
|
||||
t.Errorf("1 should be set to 1")
|
||||
}
|
||||
cache.Add(3, 3)
|
||||
if cache.Contains(1) {
|
||||
t.Errorf("should not have updated recent-ness of 1")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLRU(b *testing.B) {
|
||||
var (
|
||||
capacity = 1000
|
||||
|
|
|
|||
Loading…
Reference in a new issue