Test that a mounted module names a broken file beside its namespace, that a manifest refuses reads, and that each shipped module renders beside the modules its categories reach

This commit is contained in:
2026-10-11 13:23:30 +02:00
committed by Lillem4n
parent 89cafb1a21
commit 6a62840373
7 changed files with 32 additions and 131 deletions
-21
View File
@@ -121,27 +121,6 @@ type noEntry struct{ seg string }
func (e noEntry) Error() string { return fmt.Sprintf("no entry %q", e.seg) }
// withMissingModules adds to err, where a path names nothing, each namespace of reads that
// nothing in root provides, as the modules a loaded manifest reads and none loaded; or else
// that no loaded manifest names a module to add, the mistake being the path's own.
func withMissingModules(err error, root *folder, reads []string) error {
var ne noEntry
if !errors.As(err, &ne) {
return err
}
var missing []string
for _, namespace := range reads {
segs := strings.Split(namespace, ".")
if _, i := folderAt(root, segs); i < len(segs) {
missing = append(missing, namespace)
}
}
if len(missing) == 0 {
return fmt.Errorf("%w, and no loaded manifest names a module to add", err)
}
return fmt.Errorf("%w; is a module missing? The loaded modules read %s, which nothing loaded provides", err, strings.Join(missing, ", "))
}
// noDataNote adds to err, where a segment names nothing and f holds no data at all, that no
// data is loaded.
func (f *Generator) noDataNote(err error) error {