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:
commit
2118e85508
7 changed files with 355 additions and 378 deletions
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue