TestAutoExecAppendsInjection: cmdAutoExec, given a --with instruction, appends the marker + instruction to the prompt it hands to claude.
(t *testing.T)
| 124 | // TestAutoExecAppendsInjection: cmdAutoExec, given a --with instruction, |
| 125 | // appends the marker + instruction to the prompt it hands to claude. |
| 126 | func TestAutoExecAppendsInjection(t *testing.T) { |
| 127 | setupFlowRoot(t) |
| 128 | seedTask(t, "auto-task") |
| 129 | seedRunningAuto(t, "auto-task", 4242) |
| 130 | |
| 131 | var gotOpts harness.LaunchOpts |
| 132 | stubAutoRunner(t, func(h harness.Harness, sessionID, prompt string, opts harness.LaunchOpts) error { |
| 133 | gotOpts = opts |
| 134 | return nil |
| 135 | }) |
| 136 | |
| 137 | if rc := cmdAutoExec([]string{"auto-task", "--with", "extra instruction here"}); rc != 0 { |
| 138 | t.Fatalf("cmdAutoExec rc=%d, want 0", rc) |
| 139 | } |
| 140 | // The instruction is threaded via opts.Inject; the harness's |
| 141 | // AutoRunArgv wraps it behind InjectionMarker (covered in claude_test). |
| 142 | if gotOpts.Inject != "extra instruction here" { |
| 143 | t.Errorf("opts.Inject = %q, want the --with text", gotOpts.Inject) |
| 144 | } |
| 145 | if !gotOpts.SkipPermissions { |
| 146 | t.Errorf("auto runs must set SkipPermissions") |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // TestCmdDoAutoRefusesWhenAlreadyRunning: a second --auto launch while a |
| 151 | // prior run is still 'running' (live pid) is refused without --force. |
nothing calls this directly
no test coverage detected