1
0
Fork 0
firefox/third_party/rust/nix/test/sys/test_sysinfo.rs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
455 B
Rust

use nix::sys::sysinfo::*;
#[test]
fn sysinfo_works() {
let info = sysinfo().unwrap();
let (l1, l5, l15) = info.load_average();
assert!(l1 >= 0.0);
assert!(l5 >= 0.0);
assert!(l15 >= 0.0);
info.uptime(); // just test Duration construction
assert!(
info.swap_free() <= info.swap_total(),
"more swap available than installed (free: {}, total: {})",
info.swap_free(),
info.swap_total()
);
}