Localhost exec for windows

This commit is contained in:
veeso
2021-03-04 16:51:18 +01:00
parent 118467e079
commit 8ff7040a0a

View File

@@ -971,7 +971,10 @@ mod tests {
let tmpdir: tempfile::TempDir = tempfile::TempDir::new().unwrap();
let host: Localhost = Localhost::new(PathBuf::from(tmpdir.path())).ok().unwrap();
// Execute
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
assert_eq!(host.exec("echo 5").ok().unwrap().as_str(), "5\n");
#[cfg(target_os = "windows")]
assert_eq!(host.exec("echo 5").ok().unwrap().as_str(), "5\r\n");
}
#[test]