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
mod print_headers_tests {
    use ifstat_rs::output::print_headers;
    use indexmap::IndexMap;

    #[test]
    fn test_print_headers() {
        let stats = IndexMap::new();
        let interfaces = vec!["eth0".to_string(), "lo".to_string()];
        let mut output = Vec::new();
        print_headers(&interfaces, &mut output, false, &stats).unwrap();
        let output_str = String::from_utf8(output).unwrap();

        assert!(output_str.contains("eth0"));
        assert!(output_str.contains("lo"));
    }
}