Artifact cb9729d92317ae36e3e9832fd8c43935ee638faf415b83cebd525ceb8d11afb3:
- File
internal/index/contributor_test.go
— part of check-in
[24fdaa723a]
at
2026-08-25 19:05:45
on branch search-guards
— tests: the regression guards that were never added
Seven test files were written this session, reported as landed, and never committed: `zit commit` with no paths captures TRACKED files, and new files need `zit add` first. make check passed every time because they were on disk in the worktree, which proves nothing about what is in the check-in.
What was missing:
- search kinds, held in agreement across four places (the index list, two ops validators, the scope chips, hitOf). This is the guard that caught `doc` and again `file` the moment each was added; without it the validator silently refused a kind the chips offered. - technote edits collapsing to one timeline row, folded in three different orders, because a clone delivers artifacts in wire order. - wiki and technote search matching the CURRENT revision only, the "terrified" case. - Contributors(0) meaning every contributor rather than a silent 100. - the ops phase states, the stalled-store trap, and an empty fleet.
Verified by removing them and running the suite: it stays green, which is precisely the problem — trunk has been passing on their absence. (user: dmestas, size: 861) [annotate] [blame] [check-ins using] [more...]
package index import "testing" // people.list asks for every contributor by passing zero, and a zero // that means "a hundred" turned fossil's 151 people into a listing that // said "of 100" underneath an About panel that said 151. func TestContributorsZeroMeansAll(t *testing.T) { ix := openIndex(t) const n = 130 for i := range n { user := "user" + itoa(i) if _, err := ix.db.Exec(`INSERT INTO contributor (user, events, first, last) VALUES (?, ?, '2026-01-01T00:00:00', '2026-01-02T00:00:00')`, user, n-i); err != nil { t.Fatal(err) } } all, err := ix.Contributors(0) if err != nil { t.Fatal(err) } if len(all) != n { t.Errorf("Contributors(0) = %d, want all %d", len(all), n) } some, err := ix.Contributors(20) if err != nil { t.Fatal(err) } if len(some) != 20 { t.Errorf("Contributors(20) = %d, want 20", len(some)) } }