Skip to content

Commit

Permalink
Move the check into its own test
Browse files Browse the repository at this point in the history
  • Loading branch information
CryZe committed Jun 24, 2024
1 parent a5fe380 commit e45465c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/timing/timer/tests/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,13 +807,6 @@ mod resume_game_time {
let event = timer.resume_game_time().unwrap();

assert_eq!(event, Event::GameTimeResumed);

let time = timer
.active_attempt
.as_ref()
.unwrap()
.current_time(timer.run());
assert_ne!(time.game_time.unwrap(), time.real_time);
}

#[test]
Expand Down
16 changes: 16 additions & 0 deletions src/timing/timer/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,3 +673,19 @@ fn skipping_keeps_timer_paused() {
assert_eq!(timer.current_phase(), TimerPhase::Paused);
assert_eq!(timer.current_split_index(), Some(0));
}

#[test]
fn paused_then_resumed_game_time_lags_behind_real_time() {
let mut timer = timer();

timer.start().unwrap();
timer.pause_game_time().unwrap();
timer.resume_game_time().unwrap();

let time = timer
.active_attempt
.as_ref()
.unwrap()
.current_time(timer.run());
assert!(time.game_time.unwrap() < time.real_time);
}

0 comments on commit e45465c

Please sign in to comment.