Context:
Identified during work on #11
PR: #12
Description:
The QA review of #12 noted that a small set of error branches in internal/docscheck remain untested because fstest.MapFS cannot produce them naturally — they need an fs.FS that fails mid-walk or on ReadDir:
DocumentFiles — the fs.WalkDir callback error path and the walk's own error return
CheckAll — the branch that reports a failure to collect documents
rootEntries / CheckNamedPaths — the fs.ReadDir(".") error path
Package coverage is 94.0% after #12; these are most of the remainder.
Rationale:
Deferred from #12 as the lowest-risk gap in the package. These paths only execute if the repository root becomes unreadable mid-test, which in practice means the working tree is already broken in a way that fails the build elsewhere. The reviewer rated it "Minor... fine to defer".
Suggested approach:
A small wrapper embedding fstest.MapFS that returns a forced error from Open or ReadDir for one named path, used by two or three targeted tests. No new dependency; fstest.MapFS composes fine.
Reference:
internal/docscheck/docscheck.go — DocumentFiles, rootEntries, CheckAll
internal/docscheck/docscheck_test.go — repository fixture builder to extend
Acceptance Criteria:
Context:
Identified during work on #11
PR: #12
Description:
The QA review of #12 noted that a small set of error branches in
internal/docscheckremain untested becausefstest.MapFScannot produce them naturally — they need anfs.FSthat fails mid-walk or onReadDir:DocumentFiles— thefs.WalkDircallback error path and the walk's own error returnCheckAll— the branch that reports a failure to collect documentsrootEntries/CheckNamedPaths— thefs.ReadDir(".")error pathPackage coverage is 94.0% after #12; these are most of the remainder.
Rationale:
Deferred from #12 as the lowest-risk gap in the package. These paths only execute if the repository root becomes unreadable mid-test, which in practice means the working tree is already broken in a way that fails the build elsewhere. The reviewer rated it "Minor... fine to defer".
Suggested approach:
A small wrapper embedding
fstest.MapFSthat returns a forced error fromOpenorReadDirfor one named path, used by two or three targeted tests. No new dependency;fstest.MapFScomposes fine.Reference:
internal/docscheck/docscheck.go—DocumentFiles,rootEntries,CheckAllinternal/docscheck/docscheck_test.go—repositoryfixture builder to extendAcceptance Criteria:
fs.FSwrapper exists in the package's testsWalkDir,ReadDir, andCheckAllcollection-failure branches are each exercised and assert a specific messageinternal/docscheckdoes not regress