summaryrefslogtreecommitdiff
path: root/test/sequential/test-regress-GH-3542.js
blob: 77b8cdd69817ace3031a84d551a3ddcd3b155893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
const common = require('../common');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
let succeeded = 0;

// This test is only relevant on Windows.
if (!common.isWindows) {
  console.log('1..0 # Skipped: Windows specific test.');
  return;
}

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');
test('//localhost/c$/');
test('\\\\localhost\\c$');
test('c:\\');
test('c:');
test(process.env.windir);

process.on('exit', function() {
  assert.strictEqual(succeeded, 7);
});