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
1 changed files with 25 additions and 4 deletions

View File

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