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
+4 -5
View File
@@ -36,7 +36,7 @@ func (f *Generator) NewTemplate(input string) (*Template, error) {
}
f.mu.Lock()
defer f.mu.Unlock()
if err := loadInline(&f.root, f.manifestReads, n, "template", false); err != nil {
if err := loadInline(&f.root, n, "template", false); err != nil {
return nil, f.noDataNote(fmt.Errorf("fejkdata: %w", err))
}
return &Template{g: f, n: n}, nil
@@ -84,14 +84,13 @@ func inputValue(input string) jsonvalue.Value {
return raw
}
// loadInline loads the unloaded categories n reads, then runs n through the pipeline against root;
// reads is every namespace the loaded manifests read.
func loadInline(root *folder, reads []string, n node, label string, typedByGo bool) error {
// loadInline loads the unloaded categories n reads, then runs n through the pipeline against root.
func loadInline(root *folder, n node, label string, typedByGo bool) error {
nodes := inlineNodes(n, label)
if err := refuseFolderRefs(nodes); err != nil {
return err
}
if err := loadReached(root, reads, nil, referenced(root, nil, nodes)); err != nil {
if err := loadReached(root, nil, referenced(root, nil, nodes)); err != nil {
return loadError{err}
}
return pipeline{