Skip to content

Commit

Permalink
fix: return full path in opfs list (tonbo-io#117)
Browse files Browse the repository at this point in the history
* fix: return full path in opfs list

* fix test case
  • Loading branch information
crwen authored Jan 16, 2025
1 parent afe2d5a commit c0db165
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fusio/src/impls/disk/opfs/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ impl Fs for OPFS {
.await;

Ok(stream! {
for path in entries {
yield Ok(FileMeta{ path: path.into(), size: 0 })
for entry in entries {
yield Ok(FileMeta{ path: path.child(entry), size: 0 })
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions fusio/tests/opfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub(crate) mod tests {

let base_path = Path::from_opfs_path("test_opfs_dir".to_string()).unwrap();
let mut stream = fs.list(&base_path).await.unwrap();
let expected = ["sub_dir", "file"];
let expected = ["test_opfs_dir/sub_dir", "test_opfs_dir/file"];
let mut result_len = 0;
while let Some(Ok(meta)) = stream.next().await {
assert!(expected.contains(&meta.path.as_ref()));
Expand All @@ -74,7 +74,7 @@ pub(crate) mod tests {
.await
.unwrap();

let expected = ["sub_dir"];
let expected = ["test_opfs_dir/sub_dir"];
let mut result_len = 0;
let mut stream = fs.list(&base_path).await.unwrap();
while let Some(Ok(meta)) = stream.next().await {
Expand Down

0 comments on commit c0db165

Please sign in to comment.