mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 07:27:32 +00:00

* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
30 lines
758 B
JavaScript
30 lines
758 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.isLinux)
|
|
common.skip('Test is linux specific.');
|
|
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const assert = require('assert');
|
|
|
|
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);
|
|
});
|