diff --git a/tests/clamav_client.rs b/tests/clamav_client.rs index 41cf412..c9928c3 100644 --- a/tests/clamav_client.rs +++ b/tests/clamav_client.rs @@ -195,6 +195,19 @@ mod tokio_tests { assert_eq!(&response, clamav_client::PONG); } + #[tokio::test] + #[cfg(unix)] + async fn async_tokio_get_version_socket() { + let err_msg = format!( + "Could not get ClamAV version via Unix socket at {}", + CLAMD_HOST_SOCKET.socket_path + ); + let response = clamav_client::tokio::get_version(CLAMD_HOST_SOCKET) + .await + .expect(&err_msg); + assert!(&response.starts_with(b"ClamAV")); + } + #[tokio::test] #[cfg(unix)] async fn async_tokio_scan_socket_infected_file() { @@ -267,6 +280,18 @@ mod tokio_tests { assert_eq!(&response, clamav_client::PONG); } + #[tokio::test] + async fn async_tokio_get_version_tcp() { + let err_msg = format!( + "Could not get ClamAV version via TCP at {}", + CLAMD_HOST_TCP.host_address + ); + let response = clamav_client::tokio::get_version(CLAMD_HOST_TCP) + .await + .expect(&err_msg); + assert!(&response.starts_with(b"ClamAV")); + } + #[tokio::test] async fn async_tokio_scan_tcp_infected_file() { let err_msg = format!( @@ -466,6 +491,19 @@ mod async_std_tests { assert_eq!(&response, clamav_client::PONG); } + #[async_std::test] + #[cfg(unix)] + async fn async_std_get_version_socket() { + let err_msg = format!( + "Could not get ClamAV version via Unix socket at {}", + CLAMD_HOST_SOCKET.socket_path + ); + let response = clamav_client::async_std::get_version(CLAMD_HOST_SOCKET) + .await + .expect(&err_msg); + assert!(&response.starts_with(b"ClamAV")); + } + #[async_std::test] #[cfg(unix)] async fn async_std_scan_socket_infected_file() { @@ -538,6 +576,18 @@ mod async_std_tests { assert_eq!(&response, clamav_client::PONG); } + #[async_std::test] + async fn async_std_get_version_tcp() { + let err_msg = format!( + "Could not get ClamAV version via TCP at {}", + CLAMD_HOST_TCP.host_address + ); + let response = clamav_client::async_std::get_version(CLAMD_HOST_TCP) + .await + .expect(&err_msg); + assert!(&response.starts_with(b"ClamAV")); + } + #[async_std::test] async fn async_std_scan_tcp_infected_file() { let err_msg = format!(