(t *testing.T)
| 628 | } |
| 629 | |
| 630 | func TestGetNextStageableLineIndex(t *testing.T) { |
| 631 | type scenario struct { |
| 632 | testName string |
| 633 | patchStr string |
| 634 | indexes []int |
| 635 | expecteds []int |
| 636 | } |
| 637 | |
| 638 | scenarios := []scenario{ |
| 639 | { |
| 640 | testName: "twoHunks", |
| 641 | patchStr: twoHunks, |
| 642 | indexes: []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 1000}, |
| 643 | expecteds: []int{6, 6, 6, 6, 6, 6, 6, 7, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16}, |
| 644 | }, |
| 645 | } |
| 646 | |
| 647 | for _, s := range scenarios { |
| 648 | t.Run(s.testName, func(t *testing.T) { |
| 649 | for i, idx := range s.indexes { |
| 650 | patch := Parse(s.patchStr) |
| 651 | result := patch.GetNextChangeIdx(idx) |
| 652 | assert.Equal(t, s.expecteds[i], result) |
| 653 | } |
| 654 | }) |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | func TestAdjustLineNumber(t *testing.T) { |
| 659 | type scenario struct { |
nothing calls this directly
no test coverage detected