Skip to content

Commit a474fcd

Browse files
committed
assert that the file mode is indeed 0
1 parent 63a9c42 commit a474fcd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/parallel/test-recursive-rm-busy-loop-windows.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ function rmdirRecursiveSync() {
2222

2323
// Windows can EPERM on stat, which is called inside rmdirSync.
2424
let runTest = false;
25+
let stats;
2526
try {
26-
fs.statSync(middle);
27+
stats = fs.statSync(middle);
2728
runTest = true;
2829
} catch (err) {
2930
assert.strictEqual(err.code, 'EPERM');
3031
} finally {
3132
try {
3233
if (runTest) {
34+
// Assert that the file mode is indeed 0.
35+
assert.strictEqual(
36+
(stats.mode & Number.parseInt('777', 8)).toString(8),
37+
'0');
38+
3339
assert.throws(() => {
3440
fs.rmSync(root, { recursive: true });
3541
}, /EACCES/);

0 commit comments

Comments
 (0)