Files
Agent-Native/conformance/spec_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

42 lines
967 B
Go

package conformance
import (
"testing"
"git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec"
)
func TestFakeBackendSuite(t *testing.T) {
Suite(t, func() exec.ContractBackend {
return &FakeBackend{
Desc: exec.BackendDescriptor{
Name: "fake",
Capabilities: []exec.Capability{exec.CapText},
},
Result: exec.ContractResult{
Outcome: exec.OutcomeSucceeded,
Text: "ok",
},
}
})
}
func TestFakeCancelSemantics(t *testing.T) {
block := make(chan struct{})
b := &FakeBackend{
Desc: exec.BackendDescriptor{Name: "fake", Capabilities: []exec.Capability{exec.CapCancel}},
BlockUntil: block,
}
Run(t, Case{
Name: "cancel",
Backend: b,
Request: exec.ContractRequest{ExecutionID: "e-cancel"},
CancelAfter: 50_000_000,
WantOutcome: exec.OutcomeCanceled,
WantErrCode: exec.ErrCanceled,
})
if !b.CanceledWithCtx {
t.Fatal("backend must observe ctx cancellation before returning")
}
}