mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-16 17:18:30 +01:00
Fix process test and add more for windows
This commit is contained in:
parent
ced37d7617
commit
cdd8a7b91a
1 changed files with 25 additions and 4 deletions
|
@ -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,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue