diff --git a/src/dest.rs b/src/dest.rs index 1fe48fd..0b4706d 100644 --- a/src/dest.rs +++ b/src/dest.rs @@ -1632,4 +1632,7 @@ mod tests { assert!(tb.handler.pdu_sender.queue_empty()); tb.expected_full_data = faulty_file_data.to_vec(); } + + #[test] + fn test_file_copy_to_directory() {} } diff --git a/src/filestore.rs b/src/filestore.rs index ed17812..d53fcd3 100644 --- a/src/filestore.rs +++ b/src/filestore.rs @@ -137,6 +137,9 @@ pub trait VirtualFilestore { fn exists(&self, path: &str) -> Result; + /// Extract the file name part of a full path. + /// + /// This method should behave similarly to the [std::path::Path::file_name] method. fn file_name<'a>(&self, full_path: &'a str) -> Result, FilestoreError>; fn file_size(&self, path: &str) -> Result; @@ -213,11 +216,7 @@ pub mod std_mod { } fn file_name<'a>(&self, full_path: &'a str) -> Result, FilestoreError> { - if self.is_dir(full_path)? { - return Err(FilestoreError::IsNotFile); - } let path = Path::new(full_path); - path.file_name() .map(|s| s.to_str()) .ok_or(FilestoreError::Utf8Error)