(t *testing.T)
| 200 | } |
| 201 | |
| 202 | func (s) TestEndpointMap_Length(t *testing.T) { |
| 203 | em := NewEndpointMap[struct{}]() |
| 204 | // Should be empty at creation time. |
| 205 | if got := em.Len(); got != 0 { |
| 206 | t.Fatalf("em.Len() = %v; want 0", got) |
| 207 | } |
| 208 | // Add two endpoints with the same unordered set of addresses. This should |
| 209 | // amount to one endpoint. It should also not take into account attributes. |
| 210 | em.Set(endpoint12, struct{}{}) |
| 211 | em.Set(endpoint21, struct{}{}) |
| 212 | |
| 213 | if got := em.Len(); got != 1 { |
| 214 | t.Fatalf("em.Len() = %v; want 1", got) |
| 215 | } |
| 216 | |
| 217 | // Add another unique endpoint. This should cause the length to be 2. |
| 218 | em.Set(endpoint123, struct{}{}) |
| 219 | if got := em.Len(); got != 2 { |
| 220 | t.Fatalf("em.Len() = %v; want 2", got) |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func (s) TestEndpointMap_Get(t *testing.T) { |
| 225 | em := NewEndpointMap[int]() |
nothing calls this directly
no test coverage detected