Binary stream corruption fix
Addresses https://github.com/gulpjs/gulp/issues/2803
Seems related to https://github.com/gulpjs/vinyl-fs/issues/351
I think that the test should be the same as this test by just removing "encoding: false".
This fix seems "obviously" correct -- somehow this typo sneaked through the whole vetting or there was some merging weirdness. But I don't yet understand why this branch of the code was never reached by the tests. It's been a long time since I looked at this and there's some things I don't recognize (such as a suite of stream backends, is that right?) It would be good to have a bunch of failing tests in the old (current) situation which this PR then fixes.
There are currently no e2e binary stream tests. Here is the example of failing test, please add to the most suitable test file.
it('should not destroy binary file', function (done) {
var ranBomInputPath = path.join(testConstants.inputBase, './ranbom.bin');
var ranBomOutputPath = path.join(testConstants.outputBase, './ranbom.bin');
function assert(files) {
var srcResult = fs.readFileSync(ranBomInputPath, null);
var destResult = fs.readFileSync(ranBomOutputPath, null);
expect(srcResult).toEqual(destResult);
}
pipeline(
[
vfs.src(ranBomInputPath, { encoding: false, buffer: false }),
vfs.dest(testConstants.outputBase),
concatArray(assert),
],
done
);
});
Gentle ping, any progress on this?