Added Key() method to Item

This commit is contained in:
Suleiman Dibirov
2023-10-19 12:15:17 +03:00
parent a25552af28
commit fd8f81fe86
2 changed files with 9 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ import (
"github.com/karlseguin/ccache/v3/assert"
)
func Test_Item_Key(t *testing.T) {
item := &Item[int]{key: "foo"}
assert.Equal(t, item.Key(), "foo")
}
func Test_Item_Promotability(t *testing.T) {
item := &Item[int]{promotions: 4}
assert.Equal(t, item.shouldPromote(5), true)