Common code for implementing Twitch bots.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
337 B

package lru
import "testing"
func TestSDLRU(t *testing.T) {
lru := NewStringDecayLRU(4)
lru.Add("valid", 100)
if !lru.Check("valid", 100, 4) {
t.Error("100 + 4 should be set")
}
if !lru.Check("valid", 104, 4) {
t.Error("104 + 4 should be set")
}
if lru.Check("valid", 104, 3) {
t.Error("104 + 3 should not be set")
}
}