Skip to content

Commit

Permalink
Revert "common/lru: add test case for BasicLRU.Peek (ethereum#27559)"
Browse files Browse the repository at this point in the history
This reverts commit 1fb3aa6.
  • Loading branch information
devopsbo3 committed Nov 10, 2023
1 parent b57eb4a commit 4652392
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions common/lru/basiclru_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4652392

Please sign in to comment.