Simplify session lifecycle and MCP cleanup
This commit is contained in:
@@ -126,3 +126,19 @@ func TestPingReturnsEmptyObject(t *testing.T) {
|
||||
t.Fatal("ping result missing")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTypedInvalidArgsMapToInvalidParams(t *testing.T) {
|
||||
for _, errKind := range []string{ErrorKindInvalidArgs, ErrorKindInvalidKind} {
|
||||
_, code, msg, data := mapToolError(Errorf(errKind, "bad args"))
|
||||
if code != codeInvalidParams {
|
||||
t.Fatalf("%s code = %d, want %d", errKind, code, codeInvalidParams)
|
||||
}
|
||||
if msg != "bad args" {
|
||||
t.Fatalf("%s message = %q", errKind, msg)
|
||||
}
|
||||
kind, ok := data.(map[string]string)
|
||||
if !ok || kind["kind"] != errKind {
|
||||
t.Fatalf("%s data = %#v", errKind, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user