Say that a provider's own name is not on its consumers' entries (hq ADR 0346)

This commit is contained in:
jochen
2026-10-13 20:29:17 +02:00
parent cfacda2625
commit 985423ae61
@@ -147,3 +147,17 @@ func TestAServedNameIsCheckedWhenTheDefinitionIsRead(t *testing.T) {
t.Fatalf("its own name is accepted: %v", err)
}
}
// The provider's contributions file carries no own name on a consumer's entry (ADR 0346 §4): only what
// is derived for that consumer is there (ADR 0202 §5), and the provider reads its own names in its files.
func TestAProvidersOwnNameIsNotOnItsConsumersEntry(t *testing.T) {
m := aForgeManifest(t)
r := Resolution{Node: "home", PublicDomain: "example.org", Modules: []Manifest{m}}
derived, err := r.derivedFor("npm-package-registry", "lab_home", "lab", "", nil)
if err != nil {
t.Fatal(err)
}
if derived != nil {
t.Fatalf("a consumer's entry carries only what was derived for it: %v", derived)
}
}