1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
Matthias Hannig edd11141d3 added lru map
2018-07-11 14:56:16 +02:00

21 lines
342 B
Go

package caches
import (
"testing"
"time"
)
func TestLRUMap(t *testing.T) {
accessedAt := LRUMap{}
accessedAt["foo"] = time.Now()
accessedAt["bar"] = time.Now().Add(-2 * time.Minute)
accessedAt["bam"] = time.Now().Add(-1 * time.Minute)
lru := accessedAt.LRU()
if lru != "bar" {
t.Error("Expected bar to be LRU, got:", lru)
}
}