(t *testing.T)
| 512 | } |
| 513 | |
| 514 | func TestMergeTokensByZone(t *testing.T) { |
| 515 | tests := map[string]struct { |
| 516 | input map[string][][]uint32 |
| 517 | expected map[string][]uint32 |
| 518 | }{ |
| 519 | "empty input": { |
| 520 | input: nil, |
| 521 | expected: map[string][]uint32{}, |
| 522 | }, |
| 523 | "single zone": { |
| 524 | input: map[string][][]uint32{ |
| 525 | "zone-1": { |
| 526 | {1, 3, 4, 8}, |
| 527 | {2, 5, 6, 7}, |
| 528 | }, |
| 529 | }, |
| 530 | expected: map[string][]uint32{ |
| 531 | "zone-1": {1, 2, 3, 4, 5, 6, 7, 8}, |
| 532 | }, |
| 533 | }, |
| 534 | "multiple zones": { |
| 535 | input: map[string][][]uint32{ |
| 536 | "zone-1": { |
| 537 | {1, 3, 4, 8}, |
| 538 | {2, 5, 6, 7}, |
| 539 | }, |
| 540 | "zone-2": { |
| 541 | {3, 5}, |
| 542 | {2, 4}, |
| 543 | }, |
| 544 | }, |
| 545 | expected: map[string][]uint32{ |
| 546 | "zone-1": {1, 2, 3, 4, 5, 6, 7, 8}, |
| 547 | "zone-2": {2, 3, 4, 5}, |
| 548 | }, |
| 549 | }, |
| 550 | } |
| 551 | |
| 552 | for testName, testData := range tests { |
| 553 | t.Run(testName, func(t *testing.T) { |
| 554 | assert.Equal(t, testData.expected, MergeTokensByZone(testData.input)) |
| 555 | }) |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | func TestDesc_SplitById_JoinIds(t *testing.T) { |
| 560 | tests := map[string]struct { |
nothing calls this directly
no test coverage detected