Merge pull request #11423 from zhaodiaoer/test

test: fix broken testing code in libs
This commit is contained in:
Alex Lyn 2025-07-03 11:15:39 +08:00 committed by GitHub
commit 95d513b379
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -225,7 +225,7 @@ mod tests {
let actual = arch_guest_protection("/xyz/tmp", path.to_str().unwrap());
assert!(actual.is_ok());
assert_eq!(actual.unwrap(), GuestProtection::Snp);
assert!(matches!(actual.unwrap(), GuestProtection::Snp(_)));
writeln!(snp_file, "N").unwrap();
let actual = arch_guest_protection("/xyz/tmp", path.to_str().unwrap());
@ -244,7 +244,7 @@ mod tests {
let actual = arch_guest_protection(sev_path.to_str().unwrap(), "/xyz/tmp");
assert!(actual.is_ok());
assert_eq!(actual.unwrap(), GuestProtection::Sev);
assert!(matches!(actual.unwrap(), GuestProtection::Sev(_)));
writeln!(sev_file, "N").unwrap();
let actual = arch_guest_protection(sev_path.to_str().unwrap(), "/xyz/tmp");