MCPcopy
hub / github.com/grafana/dskit / assertMapElementsMatch

Function assertMapElementsMatch

ring/partition_instance_lifecycler_test.go:344–355  ·  view source on GitHub ↗
(t *testing.T, expected map[K]S, actual map[K]S)

Source from the content-addressed store, hash-verified

342}
343
344func assertMapElementsMatch[K cmp.Ordered, V any, S ~[]V](t *testing.T, expected map[K]S, actual map[K]S) {
345 t.Helper()
346 expectedKeys := slices.Sorted(maps.Keys(expected))
347 actualKeys := slices.Sorted(maps.Keys(actual))
348 require.Equal(t, expectedKeys, actualKeys, "expected keys do not match actual keys")
349
350 for _, k := range expectedKeys {
351 expectedValues := expected[k]
352 actualValues := actual[k]
353 assert.ElementsMatch(t, expectedValues, actualValues, "for key %v", k)
354 }
355}
356
357func TestPartitionInstanceLifecycler_GetAndChangePartitionState(t *testing.T) {
358 ctx := context.Background()

Calls 2

HelperMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected