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

Function TestPiece_Add

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

Source from the content-addressed store, hash-verified

7)
8
9func TestPiece_Add(t *testing.T) {
10 piece := NewPiece[int](10)
11 piece.Add(1, &Item[int]{expiredAt: time.Now().Unix() + 3600})
12 piece.Add(2, &Item[int]{})
13 piece.Add(3, &Item[int]{})
14 piece.Delete(3)
15 for key, item := range piece.m {
16 t.Log(key, item.Value)
17 }
18 t.Log(piece.Read(1))
19}
20
21func TestPiece_Add_Same(t *testing.T) {
22 piece := NewPiece[int](10)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected