node/test/sequential/test-regress-GH-3542.js
Brendan Ashworth 0df54303c1 test: common.js -> common
This commit changes many test styles to change all references
from require('./common.js'); to require('./common');.

The latter is much more common, with the former only being used in 50
tests. It is just a stylistic change, and it seems that `common.js` was
introduced by a rogue test and copied and pasted into the rest.

Semver: patch
PR-URL: https://github.com/iojs/io.js/pull/917
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-22 19:34:17 -08:00

33 lines
No EOL
732 B
JavaScript

// This test is only relevant on Windows.
if (process.platform !== 'win32') {
return process.exit(0);
}
var common = require('../common'),
assert = require('assert'),
fs = require('fs'),
path = require('path'),
succeeded = 0;
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);
});