/**
 * If on a windows system, there are no unix sockets.
 * So we skip this test and defaulting the asserts in the
 * process.on('exit', [...]) function to false, when we find the
 * enviroment variable 'windir' is set. I assume 'windir' will not be set on
 * *nix-systems.
 */
var common     = require('../../common');
var connection = common.createConnection({socketPath: common.fakeServerSocket});
var assert     = require('assert');

var server = common.createFakeServer();
var didConnect = false;
if (!process.env.windir) {
  server.listen(common.fakeServerSocket, function(err) {
    if (err) throw err;

    connection.connect(function(err) {
    if (err) throw err;

    assert.equal(didConnect, false);
    didConnect = true;

    connection.destroy();
    server.destroy();
    });
  });
}

var hadConnection = false;
if (!process.env.windir) {
  server.on('connection', function(connection) {
    connection.handshake();

    assert.equal(hadConnection, false);
    hadConnection = true;
  });
}

process.on('exit', function() {
  if (process.env.windir) {
    assert.equal(didConnect, false);
    assert.equal(hadConnection, false);
  } else {
    assert.equal(didConnect, true);
    assert.equal(hadConnection, true);
  }
});
@@ -4,128 +4,144 @@
 %0A * 
-If on a windows system, there are no unix sock
+This test is skipped, if the environment variable %22windir%22 is s
 et
-s
 .%0A * 
-So we skip this test and defaulting the asserts in
+It assumes that it runs on a windows system
  the
+n.
 %0A *
- 
+/%0Aif (
 process.
 on('
@@ -140,75 +140,105 @@
 ess.
-on('exit', %5B...%5D) function to false, when we find the%0A * e
+env.windir) %7B%0A  return console.log('Skipping %22test-unix-domain-socket.js%22 - E
 nviro
+n
 ment
+' %0A    + '
  var
@@ -243,24 +243,24 @@
 ariable 
-'
+%22
 windir
-'
+%22
  is set.
@@ -264,65 +264,81 @@
 et. 
-I assume 'windir' will not be set on%0A * *nix-systems.%0A */
+Skipping this, because we seem to be on' %0A    + ' a windows system');  %0A%7D
 %0Avar
@@ -562,37 +562,9 @@
 se;%0A
-if (!process.env.windir) %7B%0A  
+%0A
 serv
@@ -606,34 +606,32 @@
 function(err) %7B%0A
-  
   if (err) throw
@@ -637,18 +637,16 @@
 w err;%0A%0A
-  
   connec
@@ -812,23 +812,17 @@
 ();%0A
-    %7D);%0A
   %7D);%0A%7D
+);
 %0A%0Ava
@@ -850,37 +850,8 @@
 se;%0A
-if (!process.env.windir) %7B%0A  
 serv
@@ -895,18 +895,16 @@
 on) %7B%0A  
- 
- 
 connecti
@@ -920,18 +920,16 @@
 ake();%0A%0A
-  
   assert
@@ -958,18 +958,16 @@
 false);%0A
-  
   hadCon
@@ -982,23 +982,19 @@
 = true;%0A
-  
 %7D);
-%0A%7D
 %0A%0Aproces
@@ -1023,124 +1023,8 @@
 ) %7B%0A
-  if (process.env.windir) %7B%0A    assert.equal(didConnect, false);%0A    assert.equal(hadConnection, false);%0A  %7D else %7B%0A
     
@@ -1098,11 +1098,8 @@
 e);%0A
-  %7D%0A
 %7D);
+%0A

test reverted to previous version, added if-clause in the beginning