From c497d173b24b1b8247fac9e996e5c0fe690c1769 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 21:43:23 +0200 Subject: plan 9: undo review matches review, --min-age validated, future mtimes, rule names, conflict enum, dependency gate, absolute tool paths --- internal/extract/tools_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/extract/tools_test.go') diff --git a/internal/extract/tools_test.go b/internal/extract/tools_test.go index b481e8a..756903d 100644 --- a/internal/extract/tools_test.go +++ b/internal/extract/tools_test.go @@ -261,3 +261,18 @@ func TestFingerprintFollowsTools(t *testing.T) { t.Error("replacing pdftotext did not change the fingerprint") } } + +// TestToolLookupSkipsRelativePathEntries: a relative PATH entry would make +// a tool's path relative to the working directory - a bin/pdftotext left by +// an unpacked download - so it is ignored (review planapply F7). +func TestToolLookupSkipsRelativePathEntries(t *testing.T) { + wd := t.TempDir() + if err := os.Mkdir(filepath.Join(wd, "bin"), 0o755); err != nil { + t.Fatal(err) + } + fakeTool(t, filepath.Join(wd, "bin"), "pdftotext", "echo injected") + t.Chdir(wd) + if e := newWithPath("bin"); e.tools["pdftotext"] != "" { + t.Errorf("tool found through a relative PATH entry: %q", e.tools["pdftotext"]) + } +} -- cgit v1.3