unit test

This commit is contained in:
Quaternions 2023-10-10 02:47:17 -07:00
parent 0ee17ac3d9
commit ad862ae8c9
2 changed files with 12 additions and 1 deletions

View File

@ -47,7 +47,7 @@ pub enum InputInstruction {
//for interpolation / networking / playback reasons, most playback heads will always want
//to be 1 instruction ahead to generate the next state for interpolation.
}
#[derive(Clone)]
#[derive(Clone,Debug)]
pub struct Body {
position: glam::Vec3,//I64 where 2^32 = 1 u
velocity: glam::Vec3,//I64 where 2^32 = 1 u/s

View File

@ -148,3 +148,14 @@ impl Timer<UnpausedScaled>{
}
}
}
#[test]
fn test_timer_unscaled(){
const ONE_SECOND:TIME=1_000_000_000;
let run_prepare=paused();
let run_start=run_prepare.unpause(ONE_SECOND);
let run_finish=run_start.pause(11*ONE_SECOND);
assert_eq!(run_finish.time(),10*ONE_SECOND);
}