Files
Agent-Native/catalogcheck/align_test.go
T
weichen 6ddd3da8df Enable canonical versioned Go module consumption
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
2026-10-13 15:36:10 +00:00

35 lines
1.2 KiB
Go

package catalogcheck
import (
"testing"
"git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec"
"git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode"
)
// 常量取值必须与错误码库种子码相同。旧短字符串只作为错误码库里的别名存在。
func TestContractCodesMatchCatalog(t *testing.T) {
pairs := []struct {
got exec.ErrorCode
want errcode.Code
}{
{exec.ErrCanceled, errcode.AgentCanceled},
{exec.ErrDeadlineExceeded, errcode.AgentDeadlineExceeded},
{exec.ErrBudgetExceeded, errcode.AgentBudgetExceeded},
{exec.ErrProviderUnavailable, errcode.AgentProviderUnavailable},
{exec.ErrProviderRejected, errcode.AgentProviderRejected},
{exec.ErrToolRejected, errcode.AgentToolRejected},
{exec.ErrPathOutsideWorkspace, errcode.AgentPathOutsideWorkspace},
{exec.ErrMissingCapability, errcode.AgentMissingCapability},
{exec.ErrMissingDeliverable, errcode.AgentMissingDeliverable},
{exec.ErrEmptyOutput, errcode.AgentEmptyOutput},
{exec.ErrUnknownOutcome, errcode.AgentUnknownOutcome},
{exec.ErrInternal, errcode.AgentInternal},
}
for _, pair := range pairs {
if string(pair.got) != string(pair.want) {
t.Errorf("contract %q != catalog %q", pair.got, pair.want)
}
}
}