Skip to content

Commit 35e434e

Browse files
committed
debugging
1 parent 89eed2e commit 35e434e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/generic_storage/mmap_vec.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
use std::{
2-
fs::{File, OpenOptions},
3-
ops::{Deref, DerefMut},
4-
path::Path,
5-
};
1+
use std::fs::{File, OpenOptions};
2+
use std::ops::{Deref, DerefMut};
3+
use std::path::Path;
64

75
use bytemuck::Pod;
86
use color_eyre::eyre::bail;
@@ -242,17 +240,29 @@ mod tests {
242240
#[test]
243241
fn test_mmap_vec() {
244242
let f = tempfile::tempfile().unwrap();
243+
245244
let mut storage: MmapVec<u32> = unsafe { MmapVec::create(f.try_clone().unwrap()).unwrap() };
246245

246+
println!("{storage:?}");
247247
storage.resize(2);
248+
println!("{storage:?}");
248249

249250
storage.push(u32::MAX);
251+
println!("{storage:?}");
250252
storage.push(2);
253+
println!("{storage:?}");
254+
255+
storage.resize(4);
256+
println!("{storage:?}");
257+
251258
storage.push(42);
259+
println!("{storage:?}");
252260
storage.push(4);
261+
println!("{storage:?}");
253262

254263
assert_eq!(storage.len(), 4);
255264

265+
println!("{storage:?}");
256266
assert_eq!(storage[0], u32::MAX);
257267
assert_eq!(storage[1], 2);
258268
assert_eq!(storage[2], 42);

0 commit comments

Comments
 (0)