update pklib-rs and add some tests
This commit is contained in:
Generated
+1
-1
@@ -231,7 +231,7 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
||||
[[package]]
|
||||
name = "pklib"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/fgRuslan/pklib-rs?branch=main#cedf169266d70f10cd1d6c9fd9d3fc38fccf6604"
|
||||
source = "git+https://github.com/fgRuslan/pklib-rs?rev=d94f5bef9461c9c964c18a56cb9821de464b818e#d94f5bef9461c9c964c18a56cb9821de464b818e"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"indicatif",
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
clap = "4.6.1"
|
||||
pklib = { git = "https://github.com/fgRuslan/pklib-rs", branch = "main" }
|
||||
pklib = { git = "https://github.com/fgRuslan/pklib-rs", rev = "d94f5bef9461c9c964c18a56cb9821de464b818e" }
|
||||
rawzip = "0.4.4"
|
||||
|
||||
[profile.release]
|
||||
|
||||
+15
-1
@@ -24,7 +24,7 @@ struct Args {
|
||||
|
||||
#[test]
|
||||
fn test_large_file_implode() {
|
||||
let data = vec![0u8; 50_000];
|
||||
let data = vec![0u8; 10_000_000];
|
||||
let compressed = pklib::implode_bytes(
|
||||
&data,
|
||||
pklib::CompressionMode::Binary,
|
||||
@@ -33,6 +33,7 @@ fn test_large_file_implode() {
|
||||
.unwrap();
|
||||
let decompressed = pklib::explode_bytes(&compressed).unwrap();
|
||||
assert_eq!(data.len(), decompressed.len());
|
||||
assert_eq!(data, decompressed);
|
||||
}
|
||||
|
||||
fn implode_test(
|
||||
@@ -105,6 +106,19 @@ fn process_file(
|
||||
let (_, descriptor) = writer.finish()?;
|
||||
let compressed = entry.finish(descriptor)?;
|
||||
|
||||
/*
|
||||
|
||||
let cmp2 = pklib::implode_bytes(data, pklib::CompressionMode::Binary, pklib::DictionarySize::Size4K).unwrap();
|
||||
let dcmp2 = pklib::explode_bytes(&cmp2).unwrap();
|
||||
|
||||
let c = data.to_vec();
|
||||
|
||||
assert_eq!(data.eq(&c), true);
|
||||
assert_eq!(data.eq(&dcmp2), true);
|
||||
assert_eq!(data.len(), dcmp2.len());
|
||||
assert_eq!(dcmp2, c);
|
||||
*/
|
||||
|
||||
Ok::<(), Box<dyn std::error::Error>>(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user