MCPcopy
hub / github.com/multica-ai/multica / TestCursorErrorText

Function TestCursorErrorText

server/pkg/agent/cursor_test.go:230–252  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

228}
229
230func TestCursorErrorText(t *testing.T) {
231 t.Parallel()
232
233 tests := []struct {
234 name string
235 evt cursorStreamEvent
236 want string
237 }{
238 {"error field", cursorStreamEvent{ErrorMsg: "bad request"}, "bad request"},
239 {"detail field", cursorStreamEvent{Detail: "not found"}, "not found"},
240 {"result field", cursorStreamEvent{ResultText: "failed"}, "failed"},
241 {"empty", cursorStreamEvent{}, ""},
242 }
243
244 for _, tc := range tests {
245 t.Run(tc.name, func(t *testing.T) {
246 got := cursorErrorText(&tc.evt)
247 if got != tc.want {
248 t.Errorf("cursorErrorText = %q, want %q", got, tc.want)
249 }
250 })
251 }
252}
253
254func TestCursorUsageModelFallback(t *testing.T) {
255 t.Parallel()

Callers

nothing calls this directly

Calls 2

cursorErrorTextFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected