Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
diqiu50 committed Dec 31, 2024
1 parent 7e4d21f commit bd4de61
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
15 changes: 0 additions & 15 deletions clients/filesystem-fuse/src/default_raw_filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,6 @@ impl FileEntryManager {
#[cfg(test)]
mod tests {
use super::*;
use crate::filesystem::tests::TestRawFileSystem;
use crate::memory_filesystem::MemoryFileSystem;

#[test]
fn test_file_entry_manager() {
Expand All @@ -452,17 +450,4 @@ mod tests {
assert!(manager.get_file_entry_by_id(2).is_none());
assert!(manager.get_file_entry_by_path(Path::new("a/b")).is_none());
}

#[tokio::test]
async fn test_default_raw_file_system() {
let memory_fs = MemoryFileSystem::new().await;
let raw_fs = DefaultRawFileSystem::new(
memory_fs,
&AppConfig::default(),
&FileSystemContext::default(),
);
let _ = raw_fs.init().await;
let mut tester = TestRawFileSystem::new(raw_fs);
tester.test_raw_file_system().await;
}
}
18 changes: 17 additions & 1 deletion clients/filesystem-fuse/src/memory_filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ fn path_in_dir(dir: &Path, path: &Path) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use crate::filesystem::tests::TestPathFileSystem;
use crate::config::AppConfig;
use crate::default_raw_filesystem::DefaultRawFileSystem;
use crate::filesystem::tests::{TestPathFileSystem, TestRawFileSystem};
use crate::filesystem::{FileSystemContext, RawFileSystem};

#[test]
fn test_path_in_dir() {
Expand Down Expand Up @@ -266,4 +269,17 @@ mod tests {
let mut tester = TestPathFileSystem::new(fs);
tester.test_path_file_system().await;
}

#[tokio::test]
async fn test_memory_file_system_with_raw_file_system() {
let memory_fs = MemoryFileSystem::new().await;
let raw_fs = DefaultRawFileSystem::new(
memory_fs,
&AppConfig::default(),
&FileSystemContext::default(),
);
let _ = raw_fs.init().await;
let mut tester = TestRawFileSystem::new(raw_fs);
tester.test_raw_file_system().await;
}
}

0 comments on commit bd4de61

Please sign in to comment.