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
@@ -586,4 +586,25 @@ mod tests {
fn format_secs_above_minute() {
assert_eq!(format_secs(183), "3:03");
}
#[test]
fn format_secs_zero() {
assert_eq!(format_secs(0), "0s");
}
#[test]
fn format_secs_59_stays_below_minute() {
assert_eq!(format_secs(59), "59s");
}
#[test]
fn format_secs_60_crosses_into_minutes() {
assert_eq!(format_secs(60), "1:00");
}
#[test]
fn format_secs_pads_seconds_with_leading_zero() {
// 65 seconds = 1:05, not 1:5
assert_eq!(format_secs(65), "1:05");
}
}