MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdDoAutoWithInjection

Function TestCmdDoAutoWithInjection

internal/app/auto_test.go:107–122  ·  view source on GitHub ↗

TestCmdDoAutoWithInjection: --auto --with threads the instruction to the detached supervisor so it can append it to the autonomous prompt.

(t *testing.T)

Source from the content-addressed store, hash-verified

105// TestCmdDoAutoWithInjection: --auto --with threads the instruction to the
106// detached supervisor so it can append it to the autonomous prompt.
107func TestCmdDoAutoWithInjection(t *testing.T) {
108 setupFlowRoot(t)
109 seedTask(t, "auto-task")
110 stubITerm(t)
111 calls, _, _, _, gotInjection := stubAutoLauncher(t, 4242)
112
113 if rc := cmdDo([]string{"auto-task", "--auto", "--with", "also check the rate limiter"}); rc != 0 {
114 t.Fatalf("--auto --with rc=%d, want 0", rc)
115 }
116 if *calls != 1 {
117 t.Fatalf("autoLauncher calls = %d, want 1", *calls)
118 }
119 if *gotInjection != "also check the rate limiter" {
120 t.Errorf("injection = %q, want the --with text", *gotInjection)
121 }
122}
123
124// TestAutoExecAppendsInjection: cmdAutoExec, given a --with instruction,
125// appends the marker + instruction to the prompt it hands to claude.

Callers

nothing calls this directly

Calls 5

setupFlowRootFunction · 0.85
seedTaskFunction · 0.85
stubITermFunction · 0.85
stubAutoLauncherFunction · 0.85
cmdDoFunction · 0.85

Tested by

no test coverage detected