diff options
author | Rich Trott <rtrott@gmail.com> | 2017-07-01 08:14:28 -0700 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2017-07-04 08:00:35 -0400 |
commit | 4dd7d09723aa29ae164cf37031ed08dc6b532c0e (patch) | |
tree | 952957c8fa405ed1baccd09d741031b06cf94731 /test/parallel/test-fs-readdir-ucs2.js | |
parent | 2d2986ae72f2f5c63d95a94f05fa996d9f0609f1 (diff) | |
download | node-new-4dd7d09723aa29ae164cf37031ed08dc6b532c0e.tar.gz |
test: skip test-fs-readdir-ucs2 if no support
If the filesystem does not support UCS2, do not run the test.
PR-URL: https://github.com/nodejs/node/pull/14029
Fixes: https://github.com/nodejs/node/issues/14028
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/parallel/test-fs-readdir-ucs2.js')
-rw-r--r-- | test/parallel/test-fs-readdir-ucs2.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/parallel/test-fs-readdir-ucs2.js b/test/parallel/test-fs-readdir-ucs2.js index e8e69d6ee2..debcfb7750 100644 --- a/test/parallel/test-fs-readdir-ucs2.js +++ b/test/parallel/test-fs-readdir-ucs2.js @@ -14,16 +14,18 @@ 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+')); +try { + fs.closeSync(fs.openSync(fullpath, 'w+')); +} catch (e) { + if (e.code === 'EINVAL') + common.skip('test requires filesystem that supports UCS2'); + throw e; +} -fs.readdir(common.tmpDir, 'ucs2', (err, list) => { +fs.readdir(common.tmpDir, 'ucs2', common.mustCall((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); -}); +})); |