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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user