mirror of
https://github.com/chipsenkbeil/distant.git
synced 2024-11-17 03:25:31 +00:00
25 lines
674 B
Rust
25 lines
674 B
Rust
use distant_plugin_ssh::{Ssh, SshFamily};
|
|
use rstest::*;
|
|
use test_log::test;
|
|
|
|
use crate::sshd::*;
|
|
|
|
#[rstest]
|
|
#[test(tokio::test)]
|
|
async fn detect_family_should_return_windows_if_sshd_on_windows(#[future] ssh: Ctx<Ssh>) {
|
|
let ssh = ssh.await;
|
|
let family = ssh.detect_family().await.expect("Failed to detect family");
|
|
|
|
// NOTE: We are testing against the local machine, so if Rust was compiled for Windows, then we
|
|
// are also on a Windows machine remotely for this test!
|
|
assert_eq!(
|
|
family,
|
|
if cfg!(windows) {
|
|
SshFamily::Windows
|
|
} else {
|
|
SshFamily::Unix
|
|
},
|
|
"Got wrong family"
|
|
);
|
|
}
|