Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestLRURemoveOldest (0.43 sec)

  1. tests/lru_test.go

    	}
    	if ok {
    		t.Fatalf("should be false")
    	}
    
    	v, ok = lc.Get("key1")
    	if v != "" {
    		t.Fatalf("should be empty")
    	}
    	if ok {
    		t.Fatalf("should be false")
    	}
    }
    
    func TestLRURemoveOldest(t *testing.T) {
    	lc := lru.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")
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Sun May 25 07:40:40 UTC 2025
    - 10.4K bytes
    - Viewed (0)
Back to top