MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestPiece_Add_Same

Function TestPiece_Add_Same

internal/ttlcache/piece_test.go:21–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func TestPiece_Add_Same(t *testing.T) {
22 piece := NewPiece[int](10)
23 piece.Add(1, &Item[int]{expiredAt: time.Now().Unix() + 3600})
24 piece.Add(1, &Item[int]{expiredAt: time.Now().Unix() + 3600})
25 for key, item := range piece.m {
26 t.Log(key, item.Value)
27 }
28 t.Log(piece.Read(1))
29}
30
31func TestPiece_MaxItems(t *testing.T) {
32 piece := NewPiece[int](10)

Callers

nothing calls this directly

Calls 4

UnixMethod · 0.80
LogMethod · 0.80
AddMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected