Skip to content
Closed
Prev Previous commit
Next Next commit
test: updated syntax in test-fs-stat-bigint
  • Loading branch information
jy95 committed Sep 22, 2018
commit 90d5f02c29b8456bac32186fba58d16fe3490ae3
32 changes: 4 additions & 28 deletions test/parallel/test-fs-stat-bigint.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,10 @@ function verifyStats(bigintStats, numStats) {
`Number version ${time}, BigInt version ${time2}n`);
} else if (key === 'mode') {
assert.strictEqual(bigintStats[key], BigInt(val));
assert.strictEqual(
bigintStats.isBlockDevice(),
numStats.isBlockDevice()
);
assert.strictEqual(
bigintStats.isCharacterDevice(),
numStats.isCharacterDevice()
);
assert.strictEqual(
bigintStats.isDirectory(),
numStats.isDirectory()
);
assert.strictEqual(
bigintStats.isFIFO(),
numStats.isFIFO()
);
assert.strictEqual(
bigintStats.isFile(),
numStats.isFile()
);
assert.strictEqual(
bigintStats.isSocket(),
numStats.isSocket()
);
assert.strictEqual(
bigintStats.isSymbolicLink(),
numStats.isSymbolicLink()
);
['isBlockDevice', 'isCharacterDevice', 'isDirectory', 'isFIFO', 'isFile',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate lines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean one line for each item of the array ? Sure if you want

'isFile', 'isSocket', 'isSymbolicLink' ].forEach(
(fct) => assert.strictEqual(bigintStats[fct](), numStats[fct]()));

} else if (common.isWindows && (key === 'blksize' || key === 'blocks')) {
assert.strictEqual(bigintStats[key], undefined);
assert.strictEqual(numStats[key], undefined);
Expand Down