use crate::soft_canonicalize;
use tempfile::TempDir;
#[test]
fn test_platform_specific_path_limits() -> std::io::Result<()> {
let temp_dir = TempDir::new()?;
let base = temp_dir.path();
#[cfg(windows)]
let max_component_len = 255; #[cfg(unix)]
let max_component_len = 255;
let long_component = "a".repeat(max_component_len);
let long_path = base.join(&long_component).join("file.txt");
let result = soft_canonicalize(long_path);
match result {
Ok(canonical) => {
assert!(canonical.is_absolute());
assert!(canonical.to_string_lossy().contains(&long_component));
}
Err(e) => {
println!("Long component rejected by filesystem: {e}");
}
}
Ok(())
}