Files
Error-Code-System/domains/catalog_write_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

26 lines
508 B
Go

package domains
import (
"os"
"testing"
"error-code-system/errcode"
)
func TestWriteCatalog(t *testing.T) {
if os.Getenv("WRITE_CATALOG") != "1" {
t.Skip("set WRITE_CATALOG=1 to regenerate sys.json agent.json squad.json")
}
r := errcode.NewRegistry()
RegisterAll(r)
for _, domain := range []string{"sys", "agent", "squad"} {
data, err := ExportDomain(r, domain)
if err != nil {
t.Fatal(err)
}
if err := os.WriteFile(domain+".json", data, 0o644); err != nil {
t.Fatal(err)
}
}
}