Refactored orchestrator for staged file handling, added structured prompt support, adjusted Feishu file handling
This commit is contained in:
@@ -40,3 +40,27 @@ func TestCallWindowsDateIsNonInteractive(t *testing.T) {
|
||||
t.Fatal("expected non-empty output for date command")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRequiresShellParsing(t *testing.T) {
|
||||
if !requiresShellParsing("echo hi | cat") {
|
||||
t.Fatal("expected pipe command to require shell parsing")
|
||||
}
|
||||
if requiresShellParsing("echo hello") {
|
||||
t.Fatal("expected simple command to not require shell parsing")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCallSupportsPipeOnUnix(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("unix-only behavior test")
|
||||
}
|
||||
tool := New([]string{"echo"}, ".", 3*time.Second, 4000, nil)
|
||||
out, err := tool.Call(context.Background(), "printf hello | wc -c")
|
||||
if err != nil {
|
||||
t.Fatalf("expected pipeline command success, got err=%v output=%q", err, out)
|
||||
}
|
||||
trimmed := strings.TrimSpace(out)
|
||||
if trimmed != "5" {
|
||||
t.Fatalf("expected output 5, got %q", trimmed)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user