mirror of
https://github.com/0x5eal/rbxts-pako.git
synced 2025-04-05 11:20:58 +01:00
23 lines
590 B
JavaScript
23 lines
590 B
JavaScript
'use strict';
|
|
|
|
|
|
var fs = require('fs');
|
|
var path = require('path');
|
|
var assert = require('assert');
|
|
|
|
var pako = require('../index');
|
|
|
|
describe('ArrayBuffer', function () {
|
|
|
|
var file = path.join(__dirname, 'fixtures/samples/lorem_utf_100k.txt');
|
|
var sample = new Uint8Array(fs.readFileSync(file));
|
|
var deflated = pako.deflate(sample);
|
|
|
|
it('Deflate ArrayBuffer', function () {
|
|
assert.deepStrictEqual(deflated, pako.deflate(sample.buffer));
|
|
});
|
|
|
|
it('Inflate ArrayBuffer', function () {
|
|
assert.deepStrictEqual(sample, pako.inflate(deflated.buffer));
|
|
});
|
|
});
|