Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestLRU_Add_NewKey_AddsEntry (0.38 sec)

  1. tests/lru_test.go

    	lru.Add("key1", 1)
    	lru.Add("key1", 2)
    
    	if value, ok := lru.Get("key1"); !ok || value != 2 {
    		t.Errorf("Expected value to be updated to 2, got %v", value)
    	}
    }
    
    func TestLRU_Add_NewKey_AddsEntry(t *testing.T) {
    	lru := lru.NewLRU[string, int](10, nil, time.Hour)
    	lru.Add("key1", 1)
    
    	if value, ok := lru.Get("key1"); !ok || value != 1 {
    		t.Errorf("Expected key1 to be added with value 1, got %v", value)
    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