MCPcopy Create free account
hub / github.com/astercloud/aster / TestTaskTool_PerformanceInfo

Function TestTaskTool_PerformanceInfo

pkg/tools/builtin/task_test.go:292–322  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

290}
291
292func 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
324func TestTaskTool_Metadata(t *testing.T) {
325 t.Skip("Skipping: TaskTool doesn't include metadata field in response")

Callers

nothing calls this directly

Calls 4

NewTaskToolFunction · 0.85
ExecuteToolWithInputFunction · 0.85
AssertToolSuccessFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected