summaryrefslogtreecommitdiffstats
path: root/vendor/sysinfo/tests/disk_list.rs
blob: 164d5b93109e587b7da6f72426f53d65952ed73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Take a look at the license at the top of the repository in the LICENSE file.

#[test]
fn test_disks() {
    use sysinfo::SystemExt;

    if sysinfo::System::IS_SUPPORTED {
        let s = sysinfo::System::new_all();
        // If we don't have any physical core present, it's very likely that we're inside a VM...
        if s.physical_core_count().unwrap_or_default() > 0 {
            assert!(!s.disks().is_empty());
        }
    }
}