// Unit tests for utility functions use movie_mapper::utils::error::MovieMapperError; use movie_mapper::utils::{Result, ScannerError}; #[test] fn test_error_types() { // Test that error types can be created let _error: Result<()> = Err(MovieMapperError::Scanner(ScannerError::NotFound( "/test/path".to_string(), ))); // Test error formatting let error = ScannerError::NotFound("/test/path".to_string()); assert!(error.to_string().contains("/test/path")); } #[test] fn test_result_type_alias() { // Test that Result type alias works let result: Result = Ok("test".to_string()); assert!(result.is_ok()); } #[test] fn test_scanner_error_format() { let error = ScannerError::NotFound("/home/test".to_string()); let error_str = error.to_string(); // The error message should contain the path assert!(error_str.contains("/home/test")); // The error message should indicate it's a directory error assert!(error_str.contains("Directory not found")); }