// extern crate play_head; use play_head::{self, PlayHead}; #[test] fn start(){ let ph:PlayHead = get_play_head(); let rt = ph.time(); assert_eq!(rt,0); } #[test] fn two_times(){ let mut ph:PlayHead = get_play_head(); ph.start(); let rt = ph.time(); let number = 100000; for num in 0..number { // change it to get range () } let rt2 = ph.time(); assert_ne!(rt,rt2); } fn play_pause(){ let mut ph:PlayHead = get_play_head(); ph.start(); let start_time = ph.time(); // let mut time_after_pause:u128 ; let number = 10000; for num in 0..number { // change it to get range if num == 1 { ph.pause(); } } let time_after_pause = ph.time(); let time_after_pause_again = ph.time(); assert_eq!(time_after_pause,time_after_pause_again); } fn get_play_head()->PlayHead{ let ph:PlayHead = PlayHead::new(10000, true); ph }