28// using the caller's named author. Used to exercise per-author attribution
29// in the authors observer.
30▶func makeAuthoredRepo(t *testing.T, commits []authoredCommit) string {
31 t.Helper()
32 ProcessConstants()
· · ·
72// findAuthorRow returns the row whose canonical name matches `name`, or
73// fails the test.
74▶func findAuthorRow(t *testing.T, rows []authorRow, name string) authorRow {
75 t.Helper()
76 for _, r := range rows {
· · ·
83}
84
85▶func TestAuthorsLastToucherAttribution(t *testing.T) {
86 saveDepth := HistoryDepth
87 HistoryDepth = 100
· · ·
88▶ t.Cleanup(func() { HistoryDepth = saveDepth })
89
90 // Alice introduces 7 lines; Bob rewrites lines 4–7 (4 lines).
· · ·
91 // Net: Alice owns 3, Bob owns 4. No (before window) — full history walked.
92▶ first := "package x\nfunc A() {}\nfunc B() {}\nfunc C() {}\nfunc D() {}\nfunc E() {}\nfunc F() {}\n"
93 // 7 lines: line1=package, line2=A, line3=B, line4=C, line5=D, line6=E, line7=F.
94 // We want Bob to rewrite lines 4-7 (4 lines).
+ 48 more matches in this file