mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

Use assert.strictEqual instead of assert.equal in tests, manually convert types where necessary. PR-URL: https://github.com/nodejs/node/pull/10698 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
32 lines
772 B
JavaScript
32 lines
772 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const assert = require('assert');
|
|
|
|
if (!common.isLinux) {
|
|
common.skip('Test is linux specific.');
|
|
return;
|
|
}
|
|
|
|
common.refreshTmpDir();
|
|
const filename = '\uD83D\uDC04';
|
|
const root = Buffer.from(`${common.tmpDir}${path.sep}`);
|
|
const filebuff = Buffer.from(filename, 'ucs2');
|
|
const fullpath = Buffer.concat([root, filebuff]);
|
|
|
|
fs.closeSync(fs.openSync(fullpath, 'w+'));
|
|
|
|
fs.readdir(common.tmpDir, 'ucs2', (err, list) => {
|
|
assert.ifError(err);
|
|
assert.strictEqual(1, list.length);
|
|
const fn = list[0];
|
|
assert.deepStrictEqual(filebuff, Buffer.from(fn, 'ucs2'));
|
|
assert.strictEqual(fn, filename);
|
|
});
|
|
|
|
process.on('exit', () => {
|
|
fs.unlinkSync(fullpath);
|
|
});
|