use clingwrap::ssh::*;
#[test]
fn run_true() {
let mut ssh = Ssh::new("localhost", Args::from(vec!["true"])).command();
let output = ssh.output();
println!("{output:?}");
assert!(output.unwrap().status.success());
}
#[test]
fn run_false() {
let mut ssh = Ssh::new("localhost", Args::from(vec!["false"])).command();
let output = ssh.output();
println!("{output:?}");
assert!(!output.unwrap().status.success());
}
#[test]
fn hello_world() {
let mut ssh = Ssh::new("localhost", Args::from(vec!["echo", "hello,", "world"])).command();
let output = ssh.output().unwrap();
assert!(output.status.success());
assert_eq!(String::from_utf8_lossy(&output.stdout), "hello, world\n");
}