From b50ae251f8b6b6ef910ae25c0407efe6138bcbd7 Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "common/lru: add test case for BasicLRU.Peek (#27559)" This reverts commit 1fb3aa642eff031f72d0efdc0b174870ba616588. --- common/lru/basiclru_test.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/common/lru/basiclru_test.go b/common/lru/basiclru_test.go index 29812bda15..e2d3559f55 100644 --- a/common/lru/basiclru_test.go +++ b/common/lru/basiclru_test.go @@ -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