Add a missing [cfg(test)]

We don't always need to compile tests.
This commit is contained in:
Dmitry Ivanov
2021-07-22 16:30:57 +03:00
parent 97329d4906
commit 8b656bad5f
2 changed files with 7 additions and 2 deletions

View File

@@ -229,14 +229,17 @@ impl ReplicationConn {
}
}
#[cfg(test)]
mod tests {
use super::*;
// A no-op impl for tests
impl super::HsFeedbackSubscriber for () {}
impl HsFeedbackSubscriber for () {}
#[test]
fn test_replication_conn_background_thread_eof() {
// Test that background_thread recognizes EOF
let stream: &[u8] = &[];
super::ReplicationConn::background_thread(stream, ()).unwrap();
ReplicationConn::background_thread(stream, ()).unwrap();
}
}