test(engine): add boundary tests for format_secs and pause toggle cycle

leaderboard_plugin: format_secs was missing the 60-second crossing
boundary (1:00 vs 60s), the zero case (0s), and leading-zero padding
verification (1:05 not 1:5).

pause_plugin: added third-press test confirming the Esc toggle is
symmetric across multiple pause/resume cycles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-27 04:06:43 +00:00
parent 3d4d834c58
commit bf150f11f1
2 changed files with 45 additions and 0 deletions
+24
View File
@@ -151,4 +151,28 @@ mod tests {
0
);
}
#[test]
fn toggle_is_symmetric_for_multiple_cycles() {
let mut app = headless_app();
// Third press re-pauses after resume.
press_esc(&mut app);
app.update();
press_esc(&mut app);
app.update();
press_esc(&mut app);
app.update();
assert!(
app.world().resource::<PausedResource>().0,
"third Esc must re-pause"
);
assert_eq!(
app.world_mut()
.query::<&PauseScreen>()
.iter(app.world())
.count(),
1,
"third Esc must re-spawn PauseScreen"
);
}
}