fix: create separate test_support crates to eliminate #[allow(dead_code)] (#1667)
Because of a quirk of how implementation tests work in Rust, we had a number of `#[allow(dead_code)]` annotations that were misleading because the functions _were_ being used, just not by all integration tests in a `tests/` folder, so when compiling the test that did not use the function, clippy would complain that it was unused. This fixes things by create a "test_support" crate under the `tests/` folder that is imported as a dev dependency for the respective crate.
This commit is contained in:
@@ -191,8 +191,6 @@ impl McpProcess {
|
||||
Ok(request_id)
|
||||
}
|
||||
|
||||
// allow dead code
|
||||
#[allow(dead_code)]
|
||||
pub async fn send_response(
|
||||
&mut self,
|
||||
id: RequestId,
|
||||
@@ -220,8 +218,6 @@ impl McpProcess {
|
||||
let message = serde_json::from_str::<JSONRPCMessage>(&line)?;
|
||||
Ok(message)
|
||||
}
|
||||
// allow dead code
|
||||
#[allow(dead_code)]
|
||||
pub async fn read_stream_until_request_message(&mut self) -> anyhow::Result<JSONRPCRequest> {
|
||||
loop {
|
||||
let message = self.read_jsonrpc_message().await?;
|
||||
@@ -244,8 +240,6 @@ impl McpProcess {
|
||||
}
|
||||
}
|
||||
|
||||
// allow dead code
|
||||
#[allow(dead_code)]
|
||||
pub async fn read_stream_until_response_message(
|
||||
&mut self,
|
||||
request_id: RequestId,
|
||||
@@ -312,8 +306,6 @@ impl McpProcess {
|
||||
}
|
||||
}
|
||||
|
||||
// allow dead code
|
||||
#[allow(dead_code)]
|
||||
pub async fn send_notification(
|
||||
&mut self,
|
||||
method: &str,
|
||||
|
||||
Reference in New Issue
Block a user