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

Function TestCursorProvider_LoopCommand

internal/agent/cursor_test.go:35–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestCursorProvider_LoopCommand(t *testing.T) {
36 ctx := context.Background()
37 p := NewCursorProvider("/bin/agent")
38 cmd := p.LoopCommand(ctx, "hello world", "/work/dir")
39
40 if cmd.Path != "/bin/agent" {
41 t.Errorf("LoopCommand Path = %q, want /bin/agent", cmd.Path)
42 }
43 wantArgs := []string{"/bin/agent", "-p", "--output-format", "stream-json", "--force", "--workspace", "/work/dir", "--trust"}
44 if len(cmd.Args) != len(wantArgs) {
45 t.Fatalf("LoopCommand Args len = %d, want %d: %v", len(cmd.Args), len(wantArgs), cmd.Args)
46 }
47 for i, w := range wantArgs {
48 if cmd.Args[i] != w {
49 t.Errorf("LoopCommand Args[%d] = %q, want %q", i, cmd.Args[i], w)
50 }
51 }
52 if cmd.Dir != "/work/dir" {
53 t.Errorf("LoopCommand Dir = %q, want /work/dir", cmd.Dir)
54 }
55 if cmd.Stdin == nil {
56 t.Error("LoopCommand Stdin must be set (prompt via stdin)")
57 }
58}
59
60func TestCursorProvider_InteractiveCommand(t *testing.T) {
61 p := NewCursorProvider("/bin/agent")

Callers

nothing calls this directly

Calls 2

LoopCommandMethod · 0.95
NewCursorProviderFunction · 0.85

Tested by

no test coverage detected