(t *testing.T)
| 226 | } |
| 227 | |
| 228 | func TestResolveCommand_ToolCommand(t *testing.T) { |
| 229 | t.Parallel() |
| 230 | |
| 231 | rt := &mockRuntime{ |
| 232 | commands: types.Commands{ |
| 233 | "info": types.Command{Instruction: "Result: !echo_tool()"}, |
| 234 | }, |
| 235 | tools: []tools.Tool{ |
| 236 | { |
| 237 | Name: "echo_tool", |
| 238 | Handler: func(_ context.Context, _ tools.ToolCall) (*tools.ToolCallResult, error) { |
| 239 | return tools.ResultSuccess("hello from tool"), nil |
| 240 | }, |
| 241 | }, |
| 242 | }, |
| 243 | } |
| 244 | |
| 245 | result := ResolveCommand(t.Context(), rt, "/info") |
| 246 | assert.Equal(t, "Result: hello from tool", result) |
| 247 | } |
| 248 | |
| 249 | func TestResolveCommand_ToolCommandWithArgs(t *testing.T) { |
| 250 | t.Parallel() |
nothing calls this directly
no test coverage detected