(t *testing.T)
| 290 | } |
| 291 | |
| 292 | func TestTaskTool_PerformanceInfo(t *testing.T) { |
| 293 | tool, err := NewTaskTool(nil) |
| 294 | if err != nil { |
| 295 | t.Fatalf("Failed to create Task tool: %v", err) |
| 296 | } |
| 297 | |
| 298 | input := map[string]any{ |
| 299 | "subagent_type": "general-purpose", |
| 300 | "prompt": "Performance test task", |
| 301 | } |
| 302 | |
| 303 | result := ExecuteToolWithInput(t, tool, input) |
| 304 | result = AssertToolSuccess(t, result) |
| 305 | |
| 306 | // 验证性能相关字段 |
| 307 | if _, exists := result["duration_ms"]; !exists { |
| 308 | t.Error("Result should contain 'duration_ms' field") |
| 309 | } |
| 310 | |
| 311 | if _, exists := result["start_time"]; !exists { |
| 312 | t.Error("Result should contain 'start_time' field") |
| 313 | } |
| 314 | |
| 315 | if _, exists := result["pid"]; !exists { |
| 316 | t.Error("Result should contain 'pid' field") |
| 317 | } |
| 318 | |
| 319 | if _, exists := result["command"]; !exists { |
| 320 | t.Error("Result should contain 'command' field") |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | func TestTaskTool_Metadata(t *testing.T) { |
| 325 | t.Skip("Skipping: TaskTool doesn't include metadata field in response") |
nothing calls this directly
no test coverage detected