mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
845 B
36 lines
845 B
10 years ago
|
'use strict';
|
||
9 years ago
|
const common = require('../common');
|
||
|
const assert = require('assert');
|
||
|
const fs = require('fs');
|
||
|
const path = require('path');
|
||
|
let succeeded = 0;
|
||
13 years ago
|
|
||
10 years ago
|
// This test is only relevant on Windows.
|
||
|
if (!common.isWindows) {
|
||
10 years ago
|
console.log('1..0 # Skipped: Windows specific test.');
|
||
|
return;
|
||
10 years ago
|
}
|
||
|
|
||
13 years ago
|
function test(p) {
|
||
|
var result = fs.realpathSync(p);
|
||
9 years ago
|
assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase());
|
||
13 years ago
|
|
||
|
fs.realpath(p, function(err, result) {
|
||
|
assert.ok(!err);
|
||
9 years ago
|
assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase());
|
||
13 years ago
|
succeeded++;
|
||
|
});
|
||
|
}
|
||
|
|
||
9 years ago
|
test('//localhost/c$/Windows/System32');
|
||
|
test('//localhost/c$/Windows');
|
||
10 years ago
|
test('//localhost/c$/');
|
||
9 years ago
|
test('\\\\localhost\\c$\\');
|
||
|
test('C:\\');
|
||
|
test('C:');
|
||
13 years ago
|
test(process.env.windir);
|
||
|
|
||
|
process.on('exit', function() {
|
||
|
assert.strictEqual(succeeded, 7);
|
||
10 years ago
|
});
|