2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2015-02-22 03:47:04 +01:00
|
|
|
var common = require('../common'),
|
2012-06-27 01:59:25 +02:00
|
|
|
assert = require('assert'),
|
|
|
|
fs = require('fs'),
|
|
|
|
path = require('path'),
|
|
|
|
succeeded = 0;
|
|
|
|
|
2015-07-29 13:48:04 +02:00
|
|
|
// This test is only relevant on Windows.
|
|
|
|
if (!common.isWindows) {
|
2015-08-02 16:06:43 +02:00
|
|
|
console.log('1..0 # Skipped: Windows specific test.');
|
|
|
|
return;
|
2015-07-29 13:48:04 +02:00
|
|
|
}
|
|
|
|
|
2012-06-27 01:59:25 +02:00
|
|
|
function test(p) {
|
|
|
|
var result = fs.realpathSync(p);
|
|
|
|
assert.strictEqual(result, path.resolve(p));
|
|
|
|
|
|
|
|
fs.realpath(p, function(err, result) {
|
|
|
|
assert.ok(!err);
|
|
|
|
assert.strictEqual(result, path.resolve(p));
|
|
|
|
succeeded++;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
test('//localhost/c$/windows/system32');
|
|
|
|
test('//localhost/c$/windows');
|
2015-05-19 13:00:06 +02:00
|
|
|
test('//localhost/c$/');
|
|
|
|
test('\\\\localhost\\c$');
|
2012-06-27 01:59:25 +02:00
|
|
|
test('c:\\');
|
|
|
|
test('c:');
|
|
|
|
test(process.env.windir);
|
|
|
|
|
|
|
|
process.on('exit', function() {
|
|
|
|
assert.strictEqual(succeeded, 7);
|
2015-06-13 19:47:14 +02:00
|
|
|
});
|