Skip to content

Commit b6ff6c8

Browse files
dario-piotrowicztargos
authored andcommitted
test: add known issue tests for recursive readdir calls with Buffer path
PR-URL: #58893 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent bd4a1a5 commit b6ff6c8

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
// This test will fail because the the implementation does not properly
4+
// handle the case when the path is a Buffer and the function is called
5+
// in recursive mode.
6+
7+
// Refs: https://github.com/nodejs/node/issues/58892
8+
9+
const common = require('../common');
10+
11+
const { readdir } = require('node:fs/promises');
12+
const { join } = require('node:path');
13+
14+
const testDirPath = join(__dirname, '..', '..');
15+
readdir(Buffer.from(testDirPath), { recursive: true }).then(common.mustCall());
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
// This test will fail because the the implementation does not properly
4+
// handle the case when the path is a Buffer and the function is called
5+
// in recursive mode.
6+
7+
// Refs: https://github.com/nodejs/node/issues/58892
8+
9+
const common = require('../common');
10+
11+
const { readdir } = require('node:fs');
12+
const { join } = require('node:path');
13+
14+
const testDirPath = join(__dirname, '..', '..');
15+
readdir(Buffer.from(testDirPath), { recursive: true }, common.mustCall());
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
// This test will fail because the the implementation does not properly
4+
// handle the case when the path is a Buffer and the function is called
5+
// in recursive mode.
6+
7+
// Refs: https://github.com/nodejs/node/issues/58892
8+
9+
require('../common');
10+
11+
const { readdirSync } = require('node:fs');
12+
const { join } = require('node:path');
13+
14+
const testDirPath = join(__dirname, '..', '..');
15+
readdirSync(Buffer.from(testDirPath), { recursive: true });

0 commit comments

Comments
 (0)