fix(test): fix tool deserialization error (#68)

This commit is contained in:
4t145 2025-03-31 13:05:35 +08:00 • committed by GitHub
commit 0eea9aad4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,15 @@
use rmcp::model::{JsonRpcResponse, ServerJsonRpcMessage, ServerResult};
#[test]
fn test_tool_list_result() {
let json = std::fs::read("tests/test_deserialization/tool_list_result.json").unwrap();
let result: ServerJsonRpcMessage = serde_json::from_slice(&json).unwrap();
println!("{result:#?}");
assert!(matches!(
result,
ServerJsonRpcMessage::Response(JsonRpcResponse {
result: ServerResult::ListToolsResult(_),
..
})
));
}