(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestResolveCommand_ToolCommandWithArgs(t *testing.T) { |
| 250 | t.Parallel() |
| 251 | |
| 252 | rt := &mockRuntime{ |
| 253 | commands: types.Commands{ |
| 254 | "greet": types.Command{Instruction: "Greeting: !greet_tool(name=World)"}, |
| 255 | }, |
| 256 | tools: []tools.Tool{ |
| 257 | { |
| 258 | Name: "greet_tool", |
| 259 | Handler: func(_ context.Context, tc tools.ToolCall) (*tools.ToolCallResult, error) { |
| 260 | // Parse the args to verify they're passed correctly |
| 261 | return tools.ResultSuccess("Hello, " + tc.Function.Arguments), nil |
| 262 | }, |
| 263 | }, |
| 264 | }, |
| 265 | } |
| 266 | |
| 267 | result := ResolveCommand(t.Context(), rt, "/greet") |
| 268 | assert.Contains(t, result, "Greeting:") |
| 269 | assert.Contains(t, result, "World") |
| 270 | } |
| 271 | |
| 272 | func TestResolveCommand_ToolCommandWithQuotedArgs(t *testing.T) { |
| 273 | t.Parallel() |
nothing calls this directly
no test coverage detected