Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Aug 23, 2023
1 parent 3e73824 commit 90213af
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/gzip/uncompress_stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const compressing = require('../..');

const originalFile = path.join(__dirname, '..', 'fixtures', 'xx.log');
const sourceFile = path.join(__dirname, '..', 'fixtures', 'xx.log.gz');
const isWindows = os.platform() === 'win32';

describe('test/gzip/uncompress_stream.test.js', () => {
afterEach(mm.restore);
Expand All @@ -26,7 +27,10 @@ describe('test/gzip/uncompress_stream.test.js', () => {
const originalFileBuffer = fs.readFileSync(originalFile);
const destFileBuffer = fs.readFileSync(destFile);
assert.equal(destFileBuffer.size, originalFileBuffer.size);
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
if (!isWindows) {
// EOL not equal to linux
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
}
done();
});
});
Expand All @@ -42,7 +46,9 @@ describe('test/gzip/uncompress_stream.test.js', () => {
const originalFileBuffer = fs.readFileSync(originalFile);
const destFileBuffer = fs.readFileSync(destFile);
assert.equal(destFileBuffer.size, originalFileBuffer.size);
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
if (!isWindows) {
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
}
done();
});
});
Expand All @@ -59,7 +65,9 @@ describe('test/gzip/uncompress_stream.test.js', () => {
const originalFileBuffer = fs.readFileSync(originalFile);
const destFileBuffer = fs.readFileSync(destFile);
assert.equal(destFileBuffer.size, originalFileBuffer.size);
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
if (!isWindows) {
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
}
done();
});
});
Expand All @@ -76,7 +84,9 @@ describe('test/gzip/uncompress_stream.test.js', () => {
const originalFileBuffer = fs.readFileSync(originalFile);
const destFileBuffer = fs.readFileSync(destFile);
assert.equal(destFileBuffer.size, originalFileBuffer.size);
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
if (!isWindows) {
assert.equal(destFileBuffer.toString('utf8'), originalFileBuffer.toString('utf8'));
}
done();
});
});
Expand Down

0 comments on commit 90213af

Please sign in to comment.