(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func 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 | |
| 60 | func TestCursorProvider_InteractiveCommand(t *testing.T) { |
| 61 | p := NewCursorProvider("/bin/agent") |
nothing calls this directly
no test coverage detected