test
This commit is contained in:
parent
0c251f90fd
commit
083a735d85
@ -1 +1,4 @@
|
||||
pub mod v1;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
23
src/tests.rs
Normal file
23
src/tests.rs
Normal file
@ -0,0 +1,23 @@
|
||||
use crate::v1::TimedBlockId;
|
||||
|
||||
#[test]
|
||||
fn _1()->Result<(),crate::v1::Error>{
|
||||
let file=std::fs::File::open("files/bhop_marble_7cf33a64-7120-4514-b9fa-4fe29d9523d").unwrap();
|
||||
let input=std::io::BufReader::new(file);
|
||||
let mut bot_file=crate::v1::File::new(input).unwrap();
|
||||
println!("header={:?}",bot_file.header);
|
||||
for TimedBlockId{time,block_id} in bot_file.header.offline_blocks_timeline.clone(){
|
||||
println!("offline time={} block_id={:?}",time,block_id);
|
||||
let block=bot_file.read_block(block_id)?;
|
||||
// offline blocks include the following event types:
|
||||
// World, Gravity, Run, Camera, Setting
|
||||
}
|
||||
for TimedBlockId{time,block_id} in bot_file.header.realtime_blocks_timeline.clone(){
|
||||
println!("realtime time={} block_id={:?}",time,block_id);
|
||||
let block=bot_file.read_block(block_id)?;
|
||||
// realtime blocks include the following event types:
|
||||
// Input, Output, Sound
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user