Skip to content

Commit

Permalink
add (failing) test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Arrowood committed Nov 6, 2024
1 parent 6f12f1e commit 89d3789
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/sequential/test-fs-opendir-recursive.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function getDirentPath(dirent) {
}

function assertDirents(dirents) {
assert.strictEqual(dirents.length, expected.length);
dirents.sort((a, b) => (getDirentPath(a) < getDirentPath(b) ? -1 : 1));
assert.deepStrictEqual(
dirents.map((dirent) => {
Expand Down Expand Up @@ -221,3 +222,12 @@ function processDirCb(dir, cb) {

test().then(common.mustCall());
}

// Issue https://github.com/nodejs/node/issues/48820 highlights that
// opendir recursive does not properly handle the buffer size option.
// This test asserts that the buffer size option is respected.
{
const dir = fs.opendirSync(testDir, { bufferSize: 1, recursive: true });
processDirSync(dir);
dir.closeSync();
}

0 comments on commit 89d3789

Please sign in to comment.