Skip to content

Commit

Permalink
fix: windows support in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 18, 2022
1 parent 997f058 commit 387dfaf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const tape = require('tape')
const crypto = require('crypto')
const fs = require('fs')
const path = require('path')
const os = require('os')
const BufferList = require('../')
const { Buffer } = require('buffer')

Expand Down Expand Up @@ -506,11 +507,11 @@ tape('uninitialized memory', function (t) {
t.ok(random.equals(bl.slice()))
t.ok(random.equals(buf.slice()))

bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
bl.pipe(fs.createWriteStream(path.join(os.tmpdir(), 'bl_test_rnd_out.dat')))
.on('close', function () {
const rndhash = crypto.createHash('md5').update(random).digest('hex')
const md5sum = crypto.createHash('md5')
const s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
const s = fs.createReadStream(path.join(os.tmpdir(), 'bl_test_rnd_out.dat'))

s.on('data', md5sum.update.bind(md5sum))
s.on('end', function () {
Expand All @@ -520,8 +521,8 @@ tape('uninitialized memory', function (t) {
})
})

fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
fs.writeFileSync(path.join(os.tmpdir(), 'bl_test_rnd.dat'), random)
fs.createReadStream(path.join(os.tmpdir(), 'bl_test_rnd.dat')).pipe(bl)
})

tape('instantiation with Buffer', function (t) {
Expand Down

0 comments on commit 387dfaf

Please sign in to comment.