ifstat-rs 3.0.0

A tool to report network interface statistics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(target_os = "linux")]
mod edge_cases_tests {
    use ifstat_rs::net_stats::parse_net_dev_stats;
    use std::io::Cursor;

    #[test]
    fn test_edge_cases() {
        let data = r#"
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
  eth0:  invalid_data
"#;
        let reader = Cursor::new(data);
        let result = parse_net_dev_stats(reader);

        assert!(result.is_err());
    }
}