From a7b34f7fc446a020856b22c84bd766403ffb7d25 Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Mon, 23 Mar 2015 19:43:41 -0700 Subject: [PATCH] Disable symlink test on Windows --- examples/symlink-write.js | 45 +++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/examples/symlink-write.js b/examples/symlink-write.js index f6f5109..cb864b3 100644 --- a/examples/symlink-write.js +++ b/examples/symlink-write.js @@ -1,25 +1,28 @@ var fstream = require('../fstream.js') var notOpen = false -fstream - .Writer({ - path: 'path/to/symlink', - linkpath: './file', - isSymbolicLink: true, - mode: '0755' // octal strings supported - }) - .on('close', function () { - notOpen = true - var fs = require('fs') - var s = fs.lstatSync('path/to/symlink') - var isSym = s.isSymbolicLink() - console.log((isSym ? '' : 'not ') + 'ok 1 should be symlink') - var t = fs.readlinkSync('path/to/symlink') - var isTarget = t === './file' - console.log((isTarget ? '' : 'not ') + 'ok 2 should link to ./file') - }) - .end() +// No symlinks on Windows +if (process.platform !== 'win32') { + fstream + .Writer({ + path: 'path/to/symlink', + linkpath: './file', + isSymbolicLink: true, + mode: '0755' // octal strings supported + }) + .on('close', function () { + notOpen = true + var fs = require('fs') + var s = fs.lstatSync('path/to/symlink') + var isSym = s.isSymbolicLink() + console.log((isSym ? '' : 'not ') + 'ok 1 should be symlink') + var t = fs.readlinkSync('path/to/symlink') + var isTarget = t === './file' + console.log((isTarget ? '' : 'not ') + 'ok 2 should link to ./file') + }) + .end() -process.on('exit', function () { - console.log((notOpen ? '' : 'not ') + 'ok 3 should be closed') -}) + process.on('exit', function () { + console.log((notOpen ? '' : 'not ') + 'ok 3 should be closed') + }) +}