Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

27
vendor/sysinfo/tests/users.rs vendored Normal file
View File

@@ -0,0 +1,27 @@
// Take a look at the license at the top of the repository in the LICENSE file.
// This test is used to ensure that the users are not loaded by default.
//
// users.groupps() multiple times doesn't return the same output https://github.com/GuillaumeGomez/sysinfo/issues/1233
//
// Example:
// ---- test_users 1 stdout ----
// user: Administrator group:[Group { inner: GroupInner { id: Gid(0), name: "Administrators" } }]
// ---- test_users 2 stdout ----
// user: Administrator group:[]
#[cfg(feature = "user")]
#[test]
fn test_users() {
use sysinfo::Users;
if sysinfo::IS_SUPPORTED_SYSTEM {
let mut users = Users::new();
assert_eq!(users.iter().count(), 0);
users.refresh();
assert!(users.iter().count() > 0);
let count = users.first().unwrap().groups().iter().len();
for _ in 1..10 {
assert!(users.first().unwrap().groups().iter().len() == count)
}
}
}