#[cfg(test)] extern crate growthring; use growthring::wal::{WALLoader, WALWriter, WALRingId, WALBytes}; mod common; fn test(records: Vec, wal: &mut WALWriter) -> Box<[WALRingId]> { let records: Vec = records.into_iter().map(|s| s.into_bytes().into_boxed_slice()).collect(); let ret = wal.grow(&records); for ring_id in ret.iter() { println!("got ring id: {:?}", ring_id); } ret } #[test] fn test_rand_fail() { let mut state = common::WALStoreEmulState::new(); let mut wal = WALLoader::new(common::WALStoreEmul::new(&mut state), 9, 8, 1000).recover(); for _ in 0..3 { test(["hi", "hello", "lol"].iter().map(|s| s.to_string()).collect::>(), &mut wal); } let mut wal = WALLoader::new(common::WALStoreEmul::new(&mut state), 9, 8, 1000).recover(); }