Remove unused captured state and orphan helpers

This commit is contained in:
2026-11-05 14:33:04 +00:00
parent a91bc1608b
commit 7db5572b62
14 changed files with 16 additions and 74 deletions

View File

@@ -496,7 +496,7 @@ func TestLoadComposesLiteralKeysAndEffectivePresence(t *testing.T) {
t.Fatalf("recursive overlay failed: %+v", provider)
}
backend := loaded.result.Config.Backends[0]
if backend.QueueCapacity == nil || *backend.QueueCapacity != 0 || loaded.backends["local.v1"]["queue_capacity"] != fieldValue {
if backend.QueueCapacity == nil || *backend.QueueCapacity != 0 {
t.Fatalf("explicit zero queue capacity was lost: %+v", backend)
}
if _, err := loaded.registry.GetBackend("base/local.v1"); err != nil {
@@ -582,9 +582,6 @@ func TestLoadInterpretsBackendNormalizationAndNullDefault(t *testing.T) {
composed.APIKeyEnv == nil || *composed.APIKeyEnv != "TOKEN_NAME" || composed.QueueCapacity == nil || *composed.QueueCapacity != 1024 {
t.Fatalf("resolved backend was not normalized: %+v", composed)
}
if loaded.backends["local"]["queue_capacity"] != fieldNull {
t.Fatalf("explicit null was not retained: %+v", loaded.backends["local"])
}
field, found := loaded.result.Metadata().Lookup(configkit.Keys("backends").Index(0).Key("endpoint"))
if !found || field.Origin.Operation != configkit.ChangeNormalization {
t.Fatalf("endpoint origin was not preserved: %+v", field)
@@ -763,7 +760,7 @@ func TestLoadDefaultsAbsentQueueCapacity(t *testing.T) {
t.Fatal(err)
}
backend, err := loaded.GetBackend("local")
if err != nil || backend.APIKeyEnv != "" || backend.QueueCapacity != 1024 || loaded.result.Config.Backends[0].QueueCapacity == nil || *loaded.result.Config.Backends[0].QueueCapacity != 1024 || loaded.backends["local"]["queue_capacity"] != fieldAbsent {
if err != nil || backend.APIKeyEnv != "" || backend.QueueCapacity != 1024 || loaded.result.Config.Backends[0].QueueCapacity == nil || *loaded.result.Config.Backends[0].QueueCapacity != 1024 {
t.Fatalf("absent queue capacity did not receive its default: %+v", backend)
}
}