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

Function TestTaskTool_MissingPrompt

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

Source from the content-addressed store, hash-verified

129}
130
131func 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
151func TestTaskTool_EmptyPrompt(t *testing.T) {
152 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