Skip to content

Commit

Permalink
Disable symlink test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
avital committed Mar 24, 2015
1 parent c07de3d commit a7b34f7
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions examples/symlink-write.js
Original file line number Diff line number Diff line change
@@ -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')
})
}

0 comments on commit a7b34f7

Please sign in to comment.