Scope candidate blob readers to validation

This commit is contained in:
2026-10-09 01:30:30 +00:00
parent 33e10635b6
commit a3e993d95a
13 changed files with 244 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ func TestResolveDestinationClassifiesCommittedPaths(t *testing.T) {
if err != nil {
t.Fatal(err)
}
cleanupCandidateTree(t, tree)
if err := os.Remove(filepath.Join(repository, "docs", "inside")); err != nil {
t.Fatal(err)
}
@@ -102,6 +103,7 @@ func TestResolveDestinationHandlesExpandingCyclesAndRepeatedLinks(t *testing.T)
if err != nil {
t.Fatal(err)
}
cleanupCandidateTree(t, tree)
for _, test := range []struct {
destination string
kind DestinationKind
@@ -155,6 +157,7 @@ func TestResolveDestinationIgnoresNeighboringFiles(t *testing.T) {
if err != nil {
t.Fatal(err)
}
cleanupCandidateTree(t, tree)
gotWithoutNeighbor, err := tree.ResolveDestination(context.Background(), "docs/page.md", "outside")
if err != nil {
t.Fatal(err)
@@ -195,6 +198,7 @@ func TestResolveDestinationPreservesParentTraversalOrder(t *testing.T) {
if err != nil {
t.Fatal(err)
}
cleanupCandidateTree(t, tree)
for _, test := range []struct {
destination string
kind DestinationKind
@@ -253,6 +257,7 @@ func TestResolveDestinationMapsAbsolutePathsIntoCandidate(t *testing.T) {
if err != nil {
t.Fatal(err)
}
cleanupCandidateTree(t, tree)
if err := os.Remove(filepath.Join(repository, "README.md")); err != nil {
t.Fatal(err)
}