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

Function TestParseLineCodex_turnFailed

internal/loop/codex_parser_test.go:93–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestParseLineCodex_turnFailed(t *testing.T) {
94 line := `{"type":"turn.failed","error":{"message":"model response stream ended unexpectedly"}}`
95 ev := ParseLineCodex(line)
96 if ev == nil {
97 t.Fatal("expected event, got nil")
98 }
99 if ev.Type != EventError {
100 t.Errorf("expected EventError, got %v", ev.Type)
101 }
102 if ev.Err == nil {
103 t.Fatal("expected Err set")
104 }
105 if ev.Err.Error() != "model response stream ended unexpectedly" {
106 t.Errorf("unexpected Err: %v", ev.Err)
107 }
108}
109
110func TestParseLineCodex_error(t *testing.T) {
111 line := `{"type":"error","message":"stream error: broken pipe"}`

Callers

nothing calls this directly

Calls 1

ParseLineCodexFunction · 0.85

Tested by

no test coverage detected