8)
9
10▶func TestApplyDiffToBlameNewFile(t *testing.T) {
11 got := applyDiffToBlame(nil, 3, []LineRange{{Start: 1, Count: 3}}, nil, 7)
12 want := []authorID{7, 7, 7}
· · ·
16}
17
18▶func TestApplyDiffToBlameAppend(t *testing.T) {
19 prev := []authorID{1, 1}
20 got := applyDiffToBlame(prev, 4, []LineRange{{Start: 3, Count: 2}}, nil, 9)
· · ·
25}
26
27▶func TestApplyDiffToBlamePureDelete(t *testing.T) {
28 prev := []authorID{1, 1, 1, 1}
29 got := applyDiffToBlame(prev, 2, nil, []LineRange{{Start: 2, Count: 2}}, 9)
· · ·
34}
35
36▶func TestApplyDiffToBlameReplaceMiddle(t *testing.T) {
37 // 5 lines from author 1; replace line 3 with two lines from author 2.
38 prev := []authorID{1, 1, 1, 1, 1}
· · ·
47}
48
49▶func TestApplyDiffToBlamePadsToNewLines(t *testing.T) {
50 // Diff arithmetic disagrees with newLines — defensive pad with sentinel.
51 got := applyDiffToBlame(nil, 4, nil, nil, 9)
+ 29 more matches in this file