MCPcopy
hub / github.com/MetaCubeX/mihomo / TestEmptyMapOperations

Function TestEmptyMapOperations

common/orderedmap/orderedmap_test.go:157–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

155}
156
157func TestEmptyMapOperations(t *testing.T) {
158 om := New[string, any]()
159
160 oldValue, present := om.Get("foo")
161 assert.Nil(t, oldValue)
162 assert.Nil(t, om.Value("foo"))
163 assert.False(t, present)
164
165 oldValue, present = om.Delete("bar")
166 assert.Nil(t, oldValue)
167 assert.False(t, present)
168
169 assertLenEqual(t, om, 0)
170
171 assert.Nil(t, om.Oldest())
172 assert.Nil(t, om.Newest())
173}
174
175type dummyTestStruct struct {
176 value string

Callers

nothing calls this directly

Calls 7

assertLenEqualFunction · 0.85
OldestMethod · 0.80
NewestMethod · 0.80
NewFunction · 0.70
GetMethod · 0.65
ValueMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected