Skip to content

Commit fb3958e

Browse files
committed
test for flush
1 parent 9411d30 commit fb3958e

File tree

1 file changed

+22
-0
lines changed
  • turbopack/crates/turbo-persistence/src

1 file changed

+22
-0
lines changed

turbopack/crates/turbo-persistence/src/tests.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ fn full_cycle() -> Result<()> {
4848
},
4949
);
5050

51+
test_case(
52+
&mut test_cases,
53+
"Many SST files",
54+
|batch| {
55+
for i in 10..100u8 {
56+
batch.put(0, vec![i], vec![i].into())?;
57+
unsafe { batch.flush(0)? };
58+
}
59+
Ok(())
60+
},
61+
|db| {
62+
let Some(value) = db.get(0, &[42u8])? else {
63+
panic!("Value not found");
64+
};
65+
assert_eq!(&*value, &[42]);
66+
assert_eq!(db.get(0, &[42u8, 42])?, None);
67+
assert_eq!(db.get(0, &[1u8])?, None);
68+
assert_eq!(db.get(0, &[255u8])?, None);
69+
Ok(())
70+
},
71+
);
72+
5173
test_case(
5274
&mut test_cases,
5375
"Families",

0 commit comments

Comments
 (0)