We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8f4c40 commit d0c8b29Copy full SHA for d0c8b29
library/std/src/fs/tests.rs
@@ -1504,3 +1504,19 @@ fn create_dir_long_paths() {
1504
let path = Path::new("");
1505
assert_eq!(path.canonicalize().unwrap_err().kind(), crate::io::ErrorKind::NotFound);
1506
}
1507
+
1508
+/// Ensure ReadDir works on large directories.
1509
+/// Regression test for https://github.com/rust-lang/rust/issues/93384.
1510
+#[test]
1511
+fn read_large_dir() {
1512
+ let tmpdir = tmpdir();
1513
1514
+ let count = 32 * 1024;
1515
+ for i in 0..count {
1516
+ check!(fs::File::create(tmpdir.join(&i.to_string())));
1517
+ }
1518
1519
+ for entry in fs::read_dir(tmpdir.path()).unwrap() {
1520
+ entry.unwrap();
1521
1522
+}
0 commit comments