test metacache

This commit is contained in:
weisd
2024-12-16 09:29:44 +08:00
parent caae9a92a1
commit e7b6a17e42
2 changed files with 20 additions and 14 deletions
+7 -1
View File
@@ -2325,8 +2325,10 @@ async fn get_disk_info(drive_path: PathBuf) -> Result<(Info, bool)> {
#[cfg(test)]
mod test {
use tokio::io::BufWriter;
use utils::fs::open_file;
use utils::fs::O_RDWR;
use utils::fs::O_TRUNC;
use super::*;
@@ -2423,7 +2425,7 @@ mod test {
}
};
let mut f = match open_file("./testfile.txt", O_CREATE | O_RDWR).await {
let f = match open_file("./testfile.txt", O_CREATE | O_RDWR | O_TRUNC).await {
Ok(res) => res,
Err(err) => {
println!("openfile err {:?}", err);
@@ -2431,6 +2433,8 @@ mod test {
}
};
let buf = BufWriter::new(Vec::new());
let opts = WalkDirOptions {
bucket: "dada".to_owned(),
recursive: true,
@@ -2439,5 +2443,7 @@ mod test {
if let Err(err) = disk.walk_dir(opts, crate::io::Writer::File(f)).await {
println!("walk_dir err {:?}", err);
}
MetacacheReader::new()
}
}