From 4208f221e2d23213f482740f83d228377d36c549 Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Thu, 15 Aug 2024 13:33:58 -0400 Subject: [PATCH] check decompression in fuzzer --- fuzz/fuzz_targets/fuzz_compress.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fuzz/fuzz_targets/fuzz_compress.rs b/fuzz/fuzz_targets/fuzz_compress.rs index 81f4aaf..23f73bb 100644 --- a/fuzz/fuzz_targets/fuzz_compress.rs +++ b/fuzz/fuzz_targets/fuzz_compress.rs @@ -4,5 +4,7 @@ use libfuzzer_sys::fuzz_target; fuzz_target!(|data: &[u8]| { let table = fsst_rs::train("the quick brown fox jumped over the lazy dog".as_bytes()); - let _ = table.compress(data); + let compress = table.compress(data); + let decompress = table.decompress(&compress); + assert_eq!(&decompress, data); });