MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestCursorProvider_CleanOutput

Function TestCursorProvider_CleanOutput

internal/agent/cursor_test.go:83–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestCursorProvider_CleanOutput(t *testing.T) {
84 p := NewCursorProvider("")
85 // NDJSON: last result/success
86 ndjson := `{"type":"system","subtype":"init"}
87{"type":"result","subtype":"success","result":"final answer","session_id":"x"}`
88 if got := p.CleanOutput(ndjson); got != "final answer" {
89 t.Errorf("CleanOutput(NDJSON) = %q, want final answer", got)
90 }
91 // Single JSON result
92 single := `{"type":"result","subtype":"success","result":"single result","session_id":"x"}`
93 if got := p.CleanOutput(single); got != "single result" {
94 t.Errorf("CleanOutput(single JSON) = %q, want single result", got)
95 }
96 // No result: return as-is
97 plain := "plain text"
98 if got := p.CleanOutput(plain); got != plain {
99 t.Errorf("CleanOutput(plain) = %q, want %q", got, plain)
100 }
101}

Callers

nothing calls this directly

Calls 2

CleanOutputMethod · 0.95
NewCursorProviderFunction · 0.85

Tested by

no test coverage detected