MCPcopy Create free account
hub / github.com/elliotchance/orderedmap / TestOrderedMap_Has

Function TestOrderedMap_Has

orderedmap_test.go:360–378  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

358}
359
360func TestOrderedMap_Has(t *testing.T) {
361 t.Run("ReturnsFalseIfKeyDoesNotExist", func(t *testing.T) {
362 m := orderedmap.NewOrderedMap()
363 assert.False(t, m.Has("foo"))
364 })
365
366 t.Run("ReturnsTrueIfKeyExists", func(t *testing.T) {
367 m := orderedmap.NewOrderedMap()
368 m.Set("foo", "bar")
369 assert.True(t, m.Has("foo"))
370 })
371
372 t.Run("KeyDoesNotExistAfterDelete", func(t *testing.T) {
373 m := orderedmap.NewOrderedMap()
374 m.Set("foo", "bar")
375 m.Delete("foo")
376 assert.False(t, m.Has("foo"))
377 })
378}
379
380func benchmarkMap_Set(multiplier int) func(b *testing.B) {
381 return func(b *testing.B) {

Callers

nothing calls this directly

Calls 4

HasMethod · 0.95
SetMethod · 0.95
DeleteMethod · 0.95
NewOrderedMapFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…