Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace
27 lines
562 B
Go
27 lines
562 B
Go
package domains
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode"
|
|
)
|
|
|
|
func TestEmbeddedCatalogMatchesRegistry(t *testing.T) {
|
|
r := errcode.NewRegistry()
|
|
RegisterAll(r)
|
|
for _, domain := range []string{"sys", "agent", "squad", "intent"} {
|
|
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)
|
|
}
|
|
}
|
|
}
|