MCPcopy
hub / github.com/cilium/cilium / TestInsertOrderedMap_Insert

Function TestInsertOrderedMap_Insert

pkg/container/insert_ordered_map_test.go:28–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestInsertOrderedMap_Insert(t *testing.T) {
29 m := NewInsertOrderedMap[int, string]()
30 m.Insert(1, "1")
31 m.Insert(2, "2")
32 m.Insert(3, "3")
33 m.Insert(3, "3-3")
34 m.Insert(2, "2-2")
35 m.Insert(1, "1-1")
36 require.Equal(t, []int{1, 2, 3}, slices.Collect(m.Keys()))
37 require.Equal(t, []string{"1-1", "2-2", "3-3"}, slices.Collect(m.Values()))
38 require.Equal(t, 3, m.Len(), "Len()")
39 m.Clear()
40}
41
42func TestInsertOrderedMap_Quick(t *testing.T) {
43 err := quick.Check(func(keys []int) bool {

Callers

nothing calls this directly

Calls 8

NewInsertOrderedMapFunction · 0.85
KeysMethod · 0.80
InsertMethod · 0.65
EqualMethod · 0.65
LenMethod · 0.65
ClearMethod · 0.65
CollectMethod · 0.45
ValuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…