Skip to content

Commit

Permalink
Test child process creation
Browse files Browse the repository at this point in the history
  • Loading branch information
seamlik committed Mar 16, 2024
1 parent a071de3 commit 12080d0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions main/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@ pub enum ProcessError {

#[cfg(test)]
mod test {
#[tokio::test]
async fn eval() {
let output = super::eval("pwsh", &["-Command", "-"], b"Write-Output 123")
.await
.unwrap();
let output_text = String::from_utf8(output).unwrap();
assert_eq!(output_text.trim(), "123");
}

#[tokio::test]
async fn run() {
let output = super::run("pwsh", &["-Command", "Write-Output 123"])
.await
.unwrap();
let output_text = String::from_utf8(output).unwrap();
assert_eq!(output_text.trim(), "123");
}

#[tokio::test]
async fn probe() {
assert!(super::probe("pwsh", &["-Help"]).await);
Expand Down

0 comments on commit 12080d0

Please sign in to comment.