Fix process test and add more for windows

This commit is contained in:
Félix Saparelli 2021-04-11 04:32:48 +12:00
parent ced37d7617
commit cdd8a7b91a
No known key found for this signature in database
GPG key ID: B948C4BAE44FC474

View file

@ -523,6 +523,7 @@ fn get_longest_common_path(paths: &[PathBuf]) -> Option<String> {
#[cfg(test)] #[cfg(test)]
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
mod tests { mod tests {
use super::Shell;
use crate::pathop::PathOp; use crate::pathop::PathOp;
use std::collections::HashSet; use std::collections::HashSet;
use std::path::PathBuf; use std::path::PathBuf;
@ -533,7 +534,7 @@ mod tests {
#[test] #[test]
fn test_start() { fn test_start() {
let _ = spawn(&["echo".into(), "hi".into()], &[], true, false); let _ = spawn(&["echo".into(), "hi".into()], &[], Shell::default(), false);
} }
#[test] #[test]
@ -609,10 +610,30 @@ mod tests {
#[cfg(test)] #[cfg(test)]
#[cfg(target_family = "windows")] #[cfg(target_family = "windows")]
mod tests { mod tests {
use super::spawn; use super::{spawn, Shell};
#[test] #[test]
fn test_start() { fn test_default() {
let _ = spawn(&["echo".into(), "hi".into()], &[], true, false); let _ = spawn(&["echo".into(), "hi".into()], &[], Shell::default(), false);
}
#[test]
fn test_cmd() {
let _ = spawn(&["echo".into(), "hi".into()], &[], Shell::Cmd, false);
}
#[test]
fn test_powershell() {
let _ = spawn(&["echo".into(), "hi".into()], &[], Shell::Powershell, false);
}
#[test]
fn test_bash() {
let _ = spawn(
&["echo".into(), "hi".into()],
&[],
Shell::Unix("bash".into()),
false,
);
} }
} }