0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-path-makelong.js
Sakthipriyan Vairamani 612307564b test: make import common as the first line
The `test/common` module has the capability to identify if any variable
is leaked to the global scope and fail the test. So that has to be
imported at the beginning.

PR-URL: https://github.com/nodejs/node/pull/7786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-07-21 16:39:21 -07:00

25 lines
954 B
JavaScript

'use strict';
const common = require('../common');
var assert = require('assert');
var path = require('path');
if (common.isWindows) {
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',
path._makeLong('\\\\someserver\\someshare\\somefile'));
assert.equal('\\\\?\\UNC\\someserver\\someshare\\somefile',
path._makeLong('\\\\?\\UNC\\someserver\\someshare\\somefile'));
assert.equal('\\\\.\\pipe\\somepipe',
path._makeLong('\\\\.\\pipe\\somepipe'));
}
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);