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

Function TestOrderedMap_Copy

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

Source from the content-addressed store, hash-verified

305}
306
307func TestOrderedMap_Copy(t *testing.T) {
308 t.Run("ReturnsEqualButNotSame", func(t *testing.T) {
309 key, value := 1, "a value"
310 m := orderedmap.NewOrderedMap()
311 m.Set(key, value)
312
313 m2 := m.Copy()
314 m2.Set(key, "a different value")
315
316 assert.Equal(t, m.Len(), m2.Len(), "not all elements are copied")
317 assert.Equal(t, value, m.GetElement(key).Value)
318 })
319}
320
321func TestGetElement(t *testing.T) {
322 t.Run("ReturnsElementForKey", func(t *testing.T) {

Callers

nothing calls this directly

Calls 7

SetMethod · 0.95
CopyMethod · 0.95
LenMethod · 0.95
GetElementMethod · 0.95
NewOrderedMapFunction · 0.92
SetMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…