mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
kill: print --table as vertical (#6216)
* kill: print --table as vertical * kill: remove signal padding on --table * kill: skip exit signal in --table * kill: replace "skip" with "filter" --------- Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
parent
9b4a787be7
commit
333e4d9fe9
2 changed files with 30 additions and 8 deletions
|
@ -83,6 +83,29 @@ fn test_kill_list_all_signals_as_table() {
|
|||
.stdout_contains("HUP");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_table_starts_at_1() {
|
||||
new_ucmd!()
|
||||
.arg("-t")
|
||||
.succeeds()
|
||||
.stdout_matches(&Regex::new("^\\s?1\\sHUP").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_table_lists_all_vertically() {
|
||||
// Check for a few signals. Do not try to be comprehensive.
|
||||
let command = new_ucmd!().arg("-t").succeeds();
|
||||
let signals = command
|
||||
.stdout_str()
|
||||
.split('\n')
|
||||
.flat_map(|line| line.trim().split(" ").nth(1))
|
||||
.collect::<Vec<&str>>();
|
||||
|
||||
assert!(signals.contains(&"KILL"));
|
||||
assert!(signals.contains(&"TERM"));
|
||||
assert!(signals.contains(&"HUP"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_list_one_signal_from_name() {
|
||||
// Use SIGKILL because it is 9 on all unixes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue