File: network.rs

package info (click to toggle)
rust-sysinfo 0.30.13-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,468 kB
  • sloc: ansic: 148; makefile: 27
file content (17 lines) | stat: -rw-r--r-- 466 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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.

#[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();
        assert_eq!(n.iter().count(), 0);
        n.refresh_list();
        assert!(n.iter().count() > 0);
    }
}