Skip to content

Commit 207729b

Browse files
committed
add test for inlined object
1 parent 2fc5eb5 commit 207729b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/cas/fs.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,24 @@ mod tests {
525525
assert_eq!(stored_block.rc(), 2);
526526
}
527527

528+
#[tokio::test]
529+
async fn test_store_inlined_object() {
530+
// Setup
531+
let (fs, _dir) = setup_test_fs();
532+
let bucket_name = "test_bucket";
533+
let key = "test_key1";
534+
fs.create_bucket(bucket_name).unwrap();
535+
536+
let small_data = b"small test data".to_vec();
537+
let obj_meta = fs
538+
.store_inlined_object(bucket_name, key, small_data.clone())
539+
.unwrap();
540+
541+
// Verify inlined data
542+
assert_eq!(obj_meta.size(), small_data.len() as u64);
543+
assert_eq!(obj_meta.inlined().unwrap(), &small_data);
544+
}
545+
528546
#[tokio::test]
529547
async fn test_store_object_refcount() {
530548
// Setup

0 commit comments

Comments
 (0)