(t *testing.T)
| 129 | } |
| 130 | |
| 131 | func TestTaskTool_MissingPrompt(t *testing.T) { |
| 132 | tool, err := NewTaskTool(nil) |
| 133 | if err != nil { |
| 134 | t.Fatalf("Failed to create Task tool: %v", err) |
| 135 | } |
| 136 | |
| 137 | input := map[string]any{ |
| 138 | "subagent_type": "general-purpose", |
| 139 | // 缺少prompt字段 |
| 140 | } |
| 141 | |
| 142 | result := ExecuteToolWithInput(t, tool, input) |
| 143 | |
| 144 | errMsg := AssertToolError(t, result) |
| 145 | if !strings.Contains(strings.ToLower(errMsg), "prompt") && |
| 146 | !strings.Contains(strings.ToLower(errMsg), "required") { |
| 147 | t.Errorf("Expected prompt validation error, got: %s", errMsg) |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | func TestTaskTool_EmptyPrompt(t *testing.T) { |
| 152 | tool, err := NewTaskTool(nil) |
nothing calls this directly
no test coverage detected