make packer usable as lib

This commit is contained in:
2021-11-20 16:27:35 +01:00
parent 8f23ec711f
commit 479a2e2c89
5 changed files with 30 additions and 16 deletions

View File

@@ -1,16 +1,10 @@
mod context_state;
mod greedy_packer;
mod lz;
mod match_finder;
mod range_coder;
fn main() {
let test_data = include_bytes!("../testcases/skipahead.wasm");
let test_data = include_bytes!("../README.md");
let packed = greedy_packer::pack(test_data);
let packed = upkr::pack(test_data);
dbg!((test_data.len(), packed.len()));
let unpacked = lz::unpack(&packed);
let unpacked = upkr::unpack(&packed);
dbg!(unpacked.len());
assert!(test_data == unpacked.as_slice());
}