init push

This commit is contained in:
2026-07-16 22:16:45 +07:00
commit 8b068bdb10
1021 changed files with 332816 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package apperrorsx
import "testing"
func TestRegistry_UniqueCodeAndErrorCode(t *testing.T) {
seenCode := map[string]struct{}{}
seenErrorCode := map[string]struct{}{}
seenModuleCase := map[string]struct{}{}
for _, d := range Registry {
if d.Code == "" {
t.Fatalf("empty code in registry: %#v", d)
}
if d.ErrorCode == "" {
t.Fatalf("empty error_code in registry: %#v", d)
}
if _, ok := seenCode[d.Code]; ok {
t.Fatalf("duplicate code: %s", d.Code)
}
if _, ok := seenErrorCode[d.ErrorCode]; ok {
t.Fatalf("duplicate error_code: %s", d.ErrorCode)
}
if len(d.ErrorCode) != 7 {
t.Fatalf("invalid error_code length for %s: %s", d.Code, d.ErrorCode)
}
moduleCase := d.ErrorCode[3:]
if _, ok := seenModuleCase[moduleCase]; ok {
t.Fatalf("duplicate module+case detected: %s (error_code=%s)", moduleCase, d.ErrorCode)
}
seenCode[d.Code] = struct{}{}
seenErrorCode[d.ErrorCode] = struct{}{}
seenModuleCase[moduleCase] = struct{}{}
}
}