Skip to content

Commit

Permalink
✅ Add tests on debug trait
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlm committed Sep 18, 2023
1 parent e0230df commit 7c8ef3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/vec_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use crate::{utils::page_size, DefaultSegmentBuilder, MmapVec, SegmentBuilder};
/// .try_build()
/// .expect("Fail to create mmap vec");
/// ```
#[derive(Debug)]
pub struct MmapVecBuilder<T, SB: SegmentBuilder = DefaultSegmentBuilder> {
segment_builder: SB,
capacity: usize,
Expand Down
9 changes: 9 additions & 0 deletions tests/test_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,12 @@ fn test_reserve_in_place() {
assert_eq!(s.disk_size(), 3 * PAGE_SIZE);
}
}

#[test]
fn test_debug() {
let s = Segment::<u8>::null();
assert_eq!(
format!("{s:?}"),
"Segment { addr: 0x0, len: 0, capacity: 0, path: None }"
);
}

0 comments on commit 7c8ef3b

Please sign in to comment.