1
0
mirror of https://github.com/regular/unbzip2-stream.git synced 2024-11-25 21:16:17 +00:00
unbzip2-stream/test/extra/long.js
Stefan Friesel c7a0ce9c4a Improve long test
Using stream-compare avoids buffering the entire decompressed output
and reports errors earlier.
2018-10-08 12:44:20 +02:00

18 lines
610 B
JavaScript

var unbzip2Stream = require('../..');
var test = require('tape');
var fs = require('fs');
var streamEqual = require('stream-equal');
test('a very large binary file piped into unbzip2-stream results in original file content', function(t) {
t.plan(1);
var source = fs.createReadStream('test/fixtures/vmlinux.bin.bz2');
var expected = fs.createReadStream('test/fixtures/vmlinux.bin');
var unbz2 = unbzip2Stream();
source.pipe(unbz2);
streamEqual(expected, unbz2, function(err, equal) {
if (err)
t.ok(false, err);
t.ok(equal, "same file contents");
});
});