File: network.rs

package info (click to toggle)
rust-sysinfo 0.37.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,264 kB
  • sloc: ansic: 158; makefile: 27
file content (16 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Take a look at the license at the top of the repository in the LICENSE file.

// This test is used to ensure that the networks are not loaded by default.

#[cfg(feature = "network")]
#[test]
fn test_networks() {
    use sysinfo::Networks;

    if sysinfo::IS_SUPPORTED_SYSTEM {
        let mut n = Networks::new();
        assert_eq!(n.iter().count(), 0);
        n.refresh(false);
        assert!(n.iter().count() > 0);
    }
}