From 41930942328eea72cfaccdbb2be66dca95dbf544 Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Thu, 3 Apr 2025 18:35:41 -0400 Subject: [PATCH] add test_produce_blob_from_fit_vec --- storage/src/sc_db_utils.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/storage/src/sc_db_utils.rs b/storage/src/sc_db_utils.rs index 2ebe5f8..59f59af 100644 --- a/storage/src/sc_db_utils.rs +++ b/storage/src/sc_db_utils.rs @@ -116,3 +116,21 @@ pub fn compare_blob_lists( changed_ids } + +#[cfg(test)] +mod tests { + use super::*; + use serde::Serialize; + + const TEST_BLOB_SIZE: usize = 256; // Define a test blob size for simplicity + static SC_DATA_BLOB_SIZE: usize = TEST_BLOB_SIZE; + + #[test] + fn test_produce_blob_from_fit_vec() { + let data = (0..0 + 255).collect(); + let blob = produce_blob_from_fit_vec(data); + assert_eq!(blob[..4], [0, 1, 2, 3]); + } + + +}