1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

Merge branch 'main' into test_ls_fix

This commit is contained in:
Parag Jain 2023-03-15 17:10:54 -04:00
commit 2118e85508
7 changed files with 355 additions and 378 deletions

View file

@ -5,7 +5,7 @@ use crate::common::util::*;
use std::fs::{File, OpenOptions};
use std::io::{BufReader, Read, Write};
use std::path::PathBuf;
#[cfg(all(not(windows), not(target_os = "macos")))]
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "freebsd")))]
use std::process::{Command, Stdio};
#[cfg(not(windows))]
use std::thread::sleep;

View file

@ -138,3 +138,19 @@ fn test_kill_after_long() {
.no_stdout()
.no_stderr();
}
#[test]
fn test_kill_subprocess() {
new_ucmd!()
.args(&[
// Make sure the CI can spawn the subprocess.
"10",
"sh",
"-c",
"sh -c \"trap 'echo xyz' TERM; sleep 30\"",
])
.fails()
.code_is(124)
.stdout_contains("xyz")
.stderr_contains("Terminated");
}