MCPcopy Create free account
hub / github.com/astercloud/aster / TestChainAddStep

Function TestChainAddStep

pkg/reasoning/reasoning_test.go:28–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestChainAddStep(t *testing.T) {
29 chain := NewChain(ChainConfig{MaxSteps: 3})
30
31 step := Step{
32 Title: "Test Step",
33 Action: "Test Action",
34 Confidence: 0.9,
35 Status: StepStatusCompleted,
36 NextAction: NextActionContinue,
37 }
38
39 err := chain.AddStep(step)
40 if err != nil {
41 t.Fatalf("failed to add step: %v", err)
42 }
43
44 if len(chain.Steps) != 1 {
45 t.Errorf("expected 1 step, got %d", len(chain.Steps))
46 }
47
48 if chain.Steps[0].ID == "" {
49 t.Error("step ID should not be empty")
50 }
51}
52
53func TestChainMaxSteps(t *testing.T) {
54 chain := NewChain(ChainConfig{MaxSteps: 2})

Callers

nothing calls this directly

Calls 3

AddStepMethod · 0.95
NewChainFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected