mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 02:22:40 +00:00
fix(runtime): do not panic on irregular dir entries (#9579)
This commit is contained in:
parent
d26bef21a5
commit
687ff2ab14
2 changed files with 29 additions and 11 deletions
|
@ -78,3 +78,23 @@ unitTest({ perms: { read: false } }, async function readDirPerm(): Promise<
|
|||
await Deno.readDir("tests/")[Symbol.asyncIterator]().next();
|
||||
}, Deno.errors.PermissionDenied);
|
||||
});
|
||||
|
||||
unitTest(
|
||||
{ perms: { read: true }, ignore: Deno.build.os == "windows" },
|
||||
async function readDirDevFd(): Promise<
|
||||
void
|
||||
> {
|
||||
for await (const _ of Deno.readDir("/dev/fd")) {
|
||||
// We don't actually care whats in here; just that we don't panic on non regular entries
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
unitTest(
|
||||
{ perms: { read: true }, ignore: Deno.build.os == "windows" },
|
||||
function readDirDevFdSync(): void {
|
||||
for (const _ of Deno.readDirSync("/dev/fd")) {
|
||||
// We don't actually care whats in here; just that we don't panic on non regular file entries
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue