Files
Ruben Bridgewater d66cb4a116 benchmark,doc,lib,test: capitalize comments
This updates a lot of comments.

PR-URL: https://github.com/nodejs/node/pull/26223
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-03-04 15:13:25 +01:00

37 lines
1.2 KiB
JavaScript

'use strict';
const common = require('../../common');
if (common.isWindows && (process.env.PROCESSOR_ARCHITEW6432 !== undefined))
common.skip('doesn\'t work on WOW64');
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const tmpdir = require('../../common/tmpdir');
tmpdir.refresh();
// Make a path that is more than 260 chars long.
// Any given folder cannot have a name longer than 260 characters,
// so create 10 nested folders each with 30 character long names.
let addonDestinationDir = path.resolve(tmpdir.path);
for (let i = 0; i < 10; i++) {
addonDestinationDir = path.join(addonDestinationDir, 'x'.repeat(30));
fs.mkdirSync(addonDestinationDir);
}
const addonPath = path.join(__dirname,
'build',
common.buildType,
'binding.node');
const addonDestinationPath = path.join(addonDestinationDir, 'binding.node');
// Copy binary to long path destination
const contents = fs.readFileSync(addonPath);
fs.writeFileSync(addonDestinationPath, contents);
// Attempt to load at long path destination
const addon = require(addonDestinationPath);
assert.notStrictEqual(addon, null);
assert.strictEqual(addon.hello(), 'world');