fix compaction split bug and add 3.1 test

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-28 16:01:40 +08:00
parent 5f1b10b03b
commit 37f2c5aff0
9 changed files with 219 additions and 8 deletions

View File

@@ -35,6 +35,10 @@ impl<T: AsRef<[u8]>> Key<T> {
pub fn is_empty(&self) -> bool {
self.0.as_ref().is_empty()
}
pub fn for_testing_ts(self) -> u64 {
self.1
}
}
impl Key<Vec<u8>> {
@@ -149,6 +153,10 @@ impl<'a> Key<&'a [u8]> {
pub fn for_testing_from_slice_no_ts(slice: &'a [u8]) -> Self {
Self(slice, TS_DEFAULT)
}
pub fn for_testing_from_slice_with_ts(slice: &'a [u8], ts: u64) -> Self {
Self(slice, ts)
}
}
impl<T: AsRef<[u8]> + Debug> Debug for Key<T> {