(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestNewHandler_InvalidArguments(t *testing.T) { |
| 76 | t.Parallel() |
| 77 | |
| 78 | handler := NewHandler(func(_ context.Context, _ map[string]any) (*ToolCallResult, error) { |
| 79 | return ResultSuccess("ok"), nil |
| 80 | }) |
| 81 | |
| 82 | _, err := handler(t.Context(), ToolCall{ |
| 83 | ID: "call_1", |
| 84 | Type: "function", |
| 85 | Function: FunctionCall{ |
| 86 | Name: "broken", |
| 87 | Arguments: `{"unterminated`, |
| 88 | }, |
| 89 | }) |
| 90 | require.Error(t, err) |
| 91 | } |
| 92 | |
| 93 | // The next three tests pin the docker-agent-specific behavior of NewHandler. |
| 94 | // Repair semantics themselves are covered by github.com/docker/aijson; what |
nothing calls this directly
no test coverage detected