(t *testing.T)
| 149 | } |
| 150 | |
| 151 | func TestTaskTool_EmptyPrompt(t *testing.T) { |
| 152 | tool, err := NewTaskTool(nil) |
| 153 | if err != nil { |
| 154 | t.Fatalf("Failed to create Task tool: %v", err) |
| 155 | } |
| 156 | |
| 157 | input := map[string]any{ |
| 158 | "subagent_type": "general-purpose", |
| 159 | "prompt": "", // 空提示 |
| 160 | } |
| 161 | |
| 162 | result := ExecuteToolWithInput(t, tool, input) |
| 163 | |
| 164 | errMsg := AssertToolError(t, result) |
| 165 | if !strings.Contains(strings.ToLower(errMsg), "prompt") && |
| 166 | !strings.Contains(strings.ToLower(errMsg), "empty") { |
| 167 | t.Errorf("Expected prompt empty error, got: %s", errMsg) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestTaskTool_AllSubagentTypes(t *testing.T) { |
| 172 | tool, err := NewTaskTool(nil) |
nothing calls this directly
no test coverage detected