(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func TestMaxIterationsRejectInJSONModeWithoutYolo(t *testing.T) { |
| 215 | t.Parallel() |
| 216 | |
| 217 | rt := &mockRuntime{ |
| 218 | events: []runtime.Event{maxIterEvent(60)}, |
| 219 | } |
| 220 | |
| 221 | var buf bytes.Buffer |
| 222 | out := NewPrinter(&buf) |
| 223 | sess := session.New() |
| 224 | cfg := Config{AutoApprove: false, OutputJSON: true} |
| 225 | |
| 226 | err := Run(t.Context(), out, cfg, rt, sess, []string{"hello"}) |
| 227 | assert.NilError(t, err) |
| 228 | |
| 229 | resumes := rt.getResumes() |
| 230 | assert.Equal(t, len(resumes), 1) |
| 231 | assert.Equal(t, resumes[0].Type, runtime.ResumeTypeReject) |
| 232 | } |
| 233 | |
| 234 | // JSON mode has no stdin user — a ToolCallConfirmationEvent must be |
| 235 | // rejected even under --yolo (AutoApprove=true), because the event |
nothing calls this directly
no test coverage detected