#[tokio::test] asyncfn read_inherent() { 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();
letmut entries = fs::read_dir(p).await.unwrap();
whilelet Some(e) = assert_ok!(entries.next_entry().await) { let s = e.file_name().to_str().unwrap().to_string();
f.lock().unwrap().push(s);
}
letmut 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()]
);
}
#[tokio::test] asyncfn read_dir_entry_info() { let temp_dir = tempdir().unwrap();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.