Skip to content

Commit

Permalink
test: add cap of expire lru
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuliquan committed Jan 10, 2024
1 parent 905eb2e commit eaa4315
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions expirable/expirable_lru_test.go
Expand Up @@ -425,6 +425,10 @@ func TestLoadingExpired(t *testing.T) {
func TestLRURemoveOldest(t *testing.T) {
lc := NewLRU[string, string](2, nil, 0)

if lc.Cap() != 2 {
t.Fatalf("expect cap is 2")
}

k, v, ok := lc.RemoveOldest()
if k != "" {
t.Fatalf("should be empty")
Expand Down

0 comments on commit eaa4315

Please sign in to comment.