use any_tts::DeviceSelection;
#[test]
fn test_cpu_always_available() {
let device = DeviceSelection::Cpu.resolve().unwrap();
assert!(matches!(device, candle_core::Device::Cpu));
}
#[test]
fn test_auto_never_fails() {
let device = DeviceSelection::Auto.resolve().unwrap();
match device {
candle_core::Device::Cpu => {}
candle_core::Device::Cuda(_) => {}
candle_core::Device::Metal(_) => {}
}
}
#[test]
fn test_default_is_auto() {
assert_eq!(DeviceSelection::default(), DeviceSelection::Auto);
}
#[test]
fn test_cuda_without_feature_or_hardware() {
let result = DeviceSelection::Cuda(0).resolve();
let _ = result;
}
#[test]
fn test_metal_without_feature_or_hardware() {
let result = DeviceSelection::Metal(0).resolve();
let _ = result;
}