cosca 0.9.0

Unified cross-platform subprocess management: spawning, stdio, process trees, stable identity, and elevation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Failure fallback branches: `all_pids_or_empty`'s `Err` arm.

use super::super::all_pids_or_empty;

/// A failed snapshot is an empty list for `snapshot`'s callers, not a panic or a propagated error.
#[skuld::test]
fn all_pids_is_empty_not_a_panic_when_the_snapshot_fails() {
    let pids = all_pids_or_empty(Err(std::io::Error::from_raw_os_error(libc::EPERM)));
    assert!(
        pids.is_empty(),
        "a failed snapshot must produce an empty list, not propagate the error"
    );
}