aboutsummaryrefslogtreecommitdiff
path: root/tests/fs_dir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fs_dir.rs')
-rw-r--r--tests/fs_dir.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/fs_dir.rs b/tests/fs_dir.rs
index 6355ef0..21efe8c 100644
--- a/tests/fs_dir.rs
+++ b/tests/fs_dir.rs
@@ -85,35 +85,3 @@ async fn read_inherent() {
vec!["aa".to_string(), "bb".to_string(), "cc".to_string()]
);
}
-
-#[tokio::test]
-async fn read_stream() {
- use tokio::stream::StreamExt;
-
- let base_dir = tempdir().unwrap();
-
- let p = base_dir.path();
- std::fs::create_dir(p.join("aa")).unwrap();
- std::fs::create_dir(p.join("bb")).unwrap();
- std::fs::create_dir(p.join("cc")).unwrap();
-
- let files = Arc::new(Mutex::new(Vec::new()));
-
- let f = files.clone();
- let p = p.to_path_buf();
-
- let mut entries = fs::read_dir(p).await.unwrap();
-
- while let Some(res) = entries.next().await {
- let e = assert_ok!(res);
- let s = e.file_name().to_str().unwrap().to_string();
- f.lock().unwrap().push(s);
- }
-
- let mut files = files.lock().unwrap();
- files.sort(); // because the order is not guaranteed
- assert_eq!(
- *files,
- vec!["aa".to_string(), "bb".to_string(), "cc".to_string()]
- );
-}