use cpufetch_rs::cpu::CpuInfo;
#[test]
fn test_cpu_info_new() {
let info = CpuInfo::new().expect("Failed to detect CPU");
assert!(!info.brand_string.is_empty());
assert!(info.physical_cores > 0);
assert!(info.logical_cores > 0);
println!("Detected CPU: {info:?}");
}
#[test]
fn test_cpu_info_static() {
let info = CpuInfo::get();
assert!(!info.brand_string.is_empty());
assert!(info.physical_cores > 0);
assert!(info.logical_cores > 0);
println!("Static CPU info: {info:?}");
}
#[cfg(target_arch = "x86_64")]
#[test]
fn test_x86_64_specific() {
let info = CpuInfo::new().expect("Failed to detect CPU");
assert!(!info.features.is_empty());
println!("x86_64 CPU vendor: {}", info.vendor);
}
#[cfg(target_arch = "aarch64")]
#[test]
fn test_aarch64_specific() {
let info = CpuInfo::new().expect("Failed to detect CPU");
println!("ARM features: {:?}", info.features);
println!("ARM CPU vendor: {}", info.vendor);
}