fs: Add a regression test for #93384
This commit is contained in:
parent
f8f4c40527
commit
d0c8b29ec6
1 changed files with 16 additions and 0 deletions
|
@ -1504,3 +1504,19 @@ fn create_dir_long_paths() {
|
|||
let path = Path::new("");
|
||||
assert_eq!(path.canonicalize().unwrap_err().kind(), crate::io::ErrorKind::NotFound);
|
||||
}
|
||||
|
||||
/// Ensure ReadDir works on large directories.
|
||||
/// Regression test for https://github.com/rust-lang/rust/issues/93384.
|
||||
#[test]
|
||||
fn read_large_dir() {
|
||||
let tmpdir = tmpdir();
|
||||
|
||||
let count = 32 * 1024;
|
||||
for i in 0..count {
|
||||
check!(fs::File::create(tmpdir.join(&i.to_string())));
|
||||
}
|
||||
|
||||
for entry in fs::read_dir(tmpdir.path()).unwrap() {
|
||||
entry.unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue