Skip to content

Commit

Permalink
test: verify that \ style readlink isn't a problem
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 29, 2020
1 parent 01cdaaa commit d242054
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/write-entry.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
'use strict'
const t = require('tap')

// make our tests verify that windows link targets get turned into / paths
const fs = require('fs')
const {readlink, readlinkSync} = fs
fs.readlink = (path, cb) => {
readlink(path, (er, path) => {
if (er)
return cb(er)
else
cb(null, path.replace(/\//g, '\\'))
})
}
fs.readlinkSync = path => readlinkSync(path).replace(/\//g, '\\')

const ReadEntry = require('../lib/read-entry.js')
const makeTar = require('./make-tar.js')
const WriteEntry = require('../lib/write-entry.js')
const fs = require('fs')
const path = require('path')
const fixtures = path.resolve(__dirname, 'fixtures')
const files = path.resolve(fixtures, 'files')
Expand Down

0 comments on commit d242054

Please sign in to comment.