[agent/codex:gpt-5.4-mini] Read docs/RFC.md fully. Find ONE feature described in the sp... #52
2 changed files with 39 additions and 1 deletions
|
|
@ -662,7 +662,10 @@ func (service *Service) ResolveAll(name string) (ResolveAllResult, bool) {
|
|||
if !ok {
|
||||
if normalizeName(name) == service.ZoneApex() && service.ZoneApex() != "" {
|
||||
return ResolveAllResult{
|
||||
NS: []string{"ns." + service.ZoneApex()},
|
||||
A: []string{},
|
||||
AAAA: []string{},
|
||||
TXT: []string{},
|
||||
NS: []string{"ns." + service.ZoneApex()},
|
||||
}, true
|
||||
}
|
||||
return ResolveAllResult{
|
||||
|
|
|
|||
|
|
@ -1535,6 +1535,41 @@ func TestServiceResolveAllSynthesizesNSForDerivedZoneApex(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestServiceResolveAllReturnsStableShapeForDerivedZoneApex(t *testing.T) {
|
||||
service := NewService(ServiceOptions{
|
||||
Records: map[string]NameRecords{
|
||||
"gateway.charon.lthn": {
|
||||
A: []string{"10.10.10.10"},
|
||||
},
|
||||
"node.charon.lthn": {
|
||||
AAAA: []string{"2600:1f1c:7f0:4f01::2"},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
result, ok := service.ResolveAll("charon.lthn")
|
||||
if !ok {
|
||||
t.Fatal("expected derived zone apex to resolve")
|
||||
}
|
||||
if result.A == nil || result.AAAA == nil || result.TXT == nil || result.NS == nil {
|
||||
t.Fatalf("expected stable slice fields for derived apex, got %#v", result)
|
||||
}
|
||||
if len(result.A) != 0 || len(result.AAAA) != 0 || len(result.TXT) != 0 {
|
||||
t.Fatalf("expected empty value arrays for derived apex, got %#v", result)
|
||||
}
|
||||
if len(result.NS) != 1 || result.NS[0] != "ns.charon.lthn" {
|
||||
t.Fatalf("expected synthesized apex NS, got %#v", result.NS)
|
||||
}
|
||||
|
||||
raw, err := json.Marshal(result)
|
||||
if err != nil {
|
||||
t.Fatalf("expected derived apex payload to marshal: %v", err)
|
||||
}
|
||||
if string(raw) != `{"a":[],"aaaa":[],"txt":[],"ns":["ns.charon.lthn"]}` {
|
||||
t.Fatalf("expected stable JSON shape for derived apex, got %s", raw)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceResolveAllReturnsEmptyArraysForMissingRecordValues(t *testing.T) {
|
||||
service := NewService(ServiceOptions{
|
||||
Records: map[string]NameRecords{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue