fs/tests: Fail fast on duplicate errors rather than looping indefinitely
This commit is contained in:
parent
1550a2506d
commit
9fb7c5ae5e
1 changed files with 2 additions and 2 deletions
|
@ -1592,6 +1592,6 @@ fn test_read_dir_infinite_loop() {
|
||||||
// Skip the test if we can't open the directory in the first place
|
// Skip the test if we can't open the directory in the first place
|
||||||
let Ok(dir) = fs::read_dir(path) else { return };
|
let Ok(dir) = fs::read_dir(path) else { return };
|
||||||
|
|
||||||
// Iterate through the directory
|
// Check for duplicate errors
|
||||||
for _ in dir {}
|
assert!(dir.filter(|e| e.is_err()).take(2).count() < 2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue