2015-06-16 13:24:08 -07:00
|
|
|
'use strict';
|
2015-06-18 22:18:46 +02:00
|
|
|
const common = require('../common');
|
2017-07-01 02:29:09 +03:00
|
|
|
if (!common.isWindows)
|
|
|
|
common.skip('this test is Windows-specific.');
|
|
|
|
|
2015-06-18 22:18:46 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
2015-06-16 13:24:08 -07:00
|
|
|
|
2017-12-24 22:38:11 -08:00
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
|
|
|
2019-01-21 01:22:27 +01:00
|
|
|
// Make a path that is more than 260 chars long.
|
2017-12-24 22:38:11 -08:00
|
|
|
const dirNameLen = Math.max(260 - tmpdir.path.length, 1);
|
2023-08-15 22:45:44 +09:00
|
|
|
const dirName = tmpdir.resolve('x'.repeat(dirNameLen));
|
2015-06-18 22:18:46 +02:00
|
|
|
const fullDirPath = path.resolve(dirName);
|
|
|
|
|
|
|
|
const indexFile = path.join(fullDirPath, 'index.js');
|
|
|
|
const otherFile = path.join(fullDirPath, 'other.js');
|
2015-06-16 13:24:08 -07:00
|
|
|
|
2017-12-24 22:38:11 -08:00
|
|
|
tmpdir.refresh();
|
2015-06-16 13:24:08 -07:00
|
|
|
|
2015-06-18 22:18:46 +02:00
|
|
|
fs.mkdirSync(fullDirPath);
|
|
|
|
fs.writeFileSync(indexFile, 'require("./other");');
|
|
|
|
fs.writeFileSync(otherFile, '');
|
|
|
|
|
|
|
|
require(indexFile);
|
|
|
|
require(otherFile);
|
2015-06-16 13:24:08 -07:00
|
|
|
|
2017-12-24 22:38:11 -08:00
|
|
|
tmpdir.refresh();
|