internal/mcp: rename Make* to New*

Change-Id: I8d3d2ca125b7c24dd265937c4fe910ea823ab811
Reviewed-on: https://go-review.googlesource.com/c/tools/+/670537
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Jonathan Amsterdam 2025-05-07 11:50:44 -04:00 • committed by Robert Findley
commit e0e304e51e

View file

@ -13,26 +13,26 @@ import (
"github.com/modelcontextprotocol/go-sdk/mcp/protocol"
)
// testPromptHandler is used for type inference in TestMakePrompt.
// testPromptHandler is used for type inference in TestNewPrompt.
func testPromptHandler[T any](context.Context, *mcp.ClientConnection, T) (*protocol.GetPromptResult, error) {
panic("not implemented")
}
func TestMakePrompt(t *testing.T) {
func TestNewPrompt(t *testing.T) {
tests := []struct {
prompt *mcp.Prompt
want []protocol.PromptArgument
}{
{
mcp.MakePrompt("empty", "", testPromptHandler[struct{}]),
mcp.NewPrompt("empty", "", testPromptHandler[struct{}]),
nil,
},
{
mcp.MakePrompt("add_arg", "", testPromptHandler[struct{}], mcp.Argument("x")),
mcp.NewPrompt("add_arg", "", testPromptHandler[struct{}], mcp.Argument("x")),
[]protocol.PromptArgument{{Name: "x"}},
},
{
mcp.MakePrompt("combo", "", testPromptHandler[struct {
mcp.NewPrompt("combo", "", testPromptHandler[struct {
Name string `json:"name"`
Country string `json:"country,omitempty"`
State string
@ -48,7 +48,7 @@ func TestMakePrompt(t *testing.T) {
}
for _, test := range tests {
if diff := cmp.Diff(test.want, test.prompt.Definition.Arguments); diff != "" {
t.Errorf("MakePrompt(%v) mismatch (-want +got):\n%s", test.prompt.Definition.Name, diff)
t.Errorf("NewPrompt(%v) mismatch (-want +got):\n%s", test.prompt.Definition.Name, diff)
}
}
}