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

Function TestTaskTool_EmptyPrompt

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

Source from the content-addressed store, hash-verified

149}
150
151func 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
171func TestTaskTool_AllSubagentTypes(t *testing.T) {
172 tool, err := NewTaskTool(nil)

Callers

nothing calls this directly

Calls 3

NewTaskToolFunction · 0.85
ExecuteToolWithInputFunction · 0.85
AssertToolErrorFunction · 0.85

Tested by

no test coverage detected