mirror of
https://github.com/uutils/procps.git
synced 2026-06-10 16:14:00 -07:00
pidof: Assert number for PIDs
This commit is contained in:
@@ -46,13 +46,13 @@ fn test_s_flag() {
|
||||
let binding = new_ucmd!()
|
||||
.args(&["-s", "kthreadd", "kthreadd", "kthreadd"])
|
||||
.succeeds();
|
||||
let output = binding.stdout_str();
|
||||
let output = binding.stdout_str().trim_end();
|
||||
|
||||
let binding = output.replace('\n', "");
|
||||
let pids = binding.split(' ').collect::<Vec<_>>();
|
||||
let pids = output.split(' ').collect::<Vec<_>>();
|
||||
let first = pids[0];
|
||||
|
||||
let result = pids.iter().all(|it| *it == first);
|
||||
|
||||
assert!(result)
|
||||
assert!(result);
|
||||
assert_eq!(pids.len(), 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user