Files
Error-Code-System/domains/catalog_test.go
T
weichenandCursor bd53e9ba79
ci / vet-and-test (push) Successful in 3s
ci / docker-checkout-hostgateway (push) Successful in 3s
Add a shared error-code catalog so failures can be traced by stable codes.
Services can resolve legacy aliases and expose the catalog over CLI and HTTP instead of ad-hoc error strings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 13:43:12 +00:00

27 lines
514 B
Go

package domains
import (
"bytes"
"testing"
"error-code-system/errcode"
)
func TestEmbeddedCatalogMatchesRegistry(t *testing.T) {
r := errcode.NewRegistry()
RegisterAll(r)
for _, domain := range []string{"sys", "agent", "squad"} {
got, err := ExportDomain(r, domain)
if err != nil {
t.Fatal(err)
}
want, err := CatalogJSON(domain)
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(got, want) {
t.Fatalf("%s.json drifted from registry\n got:\n%s\nwant:\n%s", domain, got, want)
}
}
}