Files
rustytorch/crates/specialized/rtx-science/tests/device_match_test.rs
T
2026-03-04 00:08:42 +00:00

26 lines
712 B
Rust

//! TDD tests for device pattern matching
//! These tests define expected behavior for device matching
use rtx_tensor::Device;
#[test]
fn test_device_pattern_matching() {
// Pattern matching on Device should handle the enum variants properly
let device = Device::cpu();
// Match expressions should use proper patterns
let _supports_double = match device {
Device::Cpu => true,
#[cfg(feature = "cuda")]
Device::Cuda(_) => true,
#[cfg(feature = "rocm")]
Device::Rocm(_) => true,
#[cfg(feature = "metal")]
Device::Metal(_) => true,
#[allow(unreachable_patterns)]
_ => false,
};
assert!(true); // Placeholder test
}