2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-07-18 22:33:42 +02:00
|
|
|
const common = require('../common');
|
2013-02-18 19:46:50 +01:00
|
|
|
var assert = require('assert');
|
|
|
|
var path = require('path');
|
2011-11-25 09:29:06 +01:00
|
|
|
|
2015-07-29 13:48:04 +02:00
|
|
|
if (common.isWindows) {
|
2011-11-25 09:29:06 +01:00
|
|
|
var file = path.join(common.fixturesDir, 'a.js');
|
|
|
|
var resolvedFile = path.resolve(file);
|
|
|
|
|
|
|
|
assert.equal('\\\\?\\' + resolvedFile, path._makeLong(file));
|
|
|
|
assert.equal('\\\\?\\' + resolvedFile, path._makeLong('\\\\?\\' + file));
|
|
|
|
assert.equal('\\\\?\\UNC\\someserver\\someshare\\somefile',
|
2012-01-17 20:16:49 +01:00
|
|
|
path._makeLong('\\\\someserver\\someshare\\somefile'));
|
2011-11-25 09:29:06 +01:00
|
|
|
assert.equal('\\\\?\\UNC\\someserver\\someshare\\somefile',
|
2012-01-17 20:16:49 +01:00
|
|
|
path._makeLong('\\\\?\\UNC\\someserver\\someshare\\somefile'));
|
|
|
|
assert.equal('\\\\.\\pipe\\somepipe',
|
|
|
|
path._makeLong('\\\\.\\pipe\\somepipe'));
|
2011-11-25 09:29:06 +01:00
|
|
|
}
|
2013-02-18 19:46:50 +01:00
|
|
|
|
|
|
|
assert.equal(path._makeLong(null), null);
|
|
|
|
assert.equal(path._makeLong(100), 100);
|
|
|
|
assert.equal(path._makeLong(path), path);
|
|
|
|
assert.equal(path._makeLong(false), false);
|
|
|
|
assert.equal(path._makeLong(true), true);
|