mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-05 15:36:52 +08:00
20 lines
289 B
Go
20 lines
289 B
Go
package algorithm
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/duke-git/lancet/internal"
|
|
)
|
|
|
|
func TestLRUCache(t *testing.T) {
|
|
asssert := internal.NewAssert(t, "TestLRUCache")
|
|
|
|
cache := NewLRUCache[int, int](2)
|
|
|
|
cache.Put(1, 1)
|
|
cache.Put(2, 2)
|
|
|
|
_, ok := cache.Get(0)
|
|
asssert.Equal(false, ok)
|
|
}
|