We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a25552a commit fd8f81fCopy full SHA for fd8f81f
item.go
@@ -55,6 +55,10 @@ func (i *Item[T]) shouldPromote(getsPerPromote int32) bool {
55
return i.promotions == getsPerPromote
56
}
57
58
+func (i *Item[T]) Key() string {
59
+ return i.key
60
+}
61
+
62
func (i *Item[T]) Value() T {
63
return i.value
64
item_test.go
@@ -8,6 +8,11 @@ import (
8
"github.com/karlseguin/ccache/v3/assert"
9
)
10
11
+func Test_Item_Key(t *testing.T) {
12
+ item := &Item[int]{key: "foo"}
13
+ assert.Equal(t, item.Key(), "foo")
14
15
16
func Test_Item_Promotability(t *testing.T) {
17
item := &Item[int]{promotions: 4}
18
assert.Equal(t, item.shouldPromote(5), true)
0 commit comments