Skip to content

Commit

Permalink
papercut; but at least the process should be a single char and not Zo…
Browse files Browse the repository at this point in the history
…mbie, Traced or Deepsleeping
  • Loading branch information
squell committed Oct 22, 2024
1 parent f70da0f commit cbefe0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,9 @@ mod tests {
#[test]
fn proc_stat_test() {
use super::{read_proc_stat, Process, WithProcess::Current};
// the process is 'sleeping' (apparently)
assert_eq!("S", read_proc_stat::<String>(Current, 2).unwrap());
// The process can be 'sleeping' or 'running': it looks like the state field of /proc/pid/stat
// will show the state for the main thread of the process rather than for the process as a whole.
assert!("SR".contains(read_proc_stat::<char>(Current, 2).unwrap()));
let parent = Process::parent_id().unwrap();
// field 3 is always the parent process
assert_eq!(parent, read_proc_stat::<i32>(Current, 3).unwrap());
Expand Down

0 comments on commit cbefe0c

Please sign in to comment.