Skip to content
Snippets Groups Projects
Commit e573579b authored by Wolfgang Welz's avatar Wolfgang Welz
Browse files

Fix compute if absent test for lru

parent 06a92696
No related branches found
No related tags found
No related merge requests found
......@@ -56,9 +56,16 @@ func TestLRUCache(t *testing.T) {
t.Error("'b' should have been dropped")
}
cache.ComputeIfAbsent("tust", func() interface{} {
return 1337
})
{
key, value := "test2", 1337
cache.ComputeIfAbsent(key, func() interface{} {
return value
})
if cache.Get(key) != value {
t.Error("'" + key + "' should have been added")
}
}
if cache.GetSize() != 5 {
t.Error("the size should be 5")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment