(t *testing.T)
| 279 | } |
| 280 | |
| 281 | func TestOrderedMap_Copy(t *testing.T) { |
| 282 | t.Run("ReturnsEqualButNotSame", func(t *testing.T) { |
| 283 | key, value := 1, "a value" |
| 284 | m := orderedmap.NewOrderedMap[int, string]() |
| 285 | m.Set(key, value) |
| 286 | |
| 287 | m2 := m.Copy() |
| 288 | m2.Set(key, "a different value") |
| 289 | |
| 290 | assert.Equal(t, m.Len(), m2.Len(), "not all elements are copied") |
| 291 | assert.Equal(t, value, m.GetElement(key).Value) |
| 292 | }) |
| 293 | } |
| 294 | |
| 295 | func TestGetElement(t *testing.T) { |
| 296 | t.Run("ReturnsElementForKey", func(t *testing.T) { |