test(format): pin the sub-minute truncation (E9 R2)

Round 2 mutation-checked round 1's own fix and found the one line it left
uncovered: every table row was an integer, so `Math.floor(sec)` in the new
seconds tier could be deleted or swapped for round/ceil with the suite still
green — exactly the "later cleanup removes it as redundant" failure the fix's
comment claims to prevent. Two fractional rows kill all three mutants.
This commit is contained in:
2026-09-03 21:51:14 +02:00
parent ada95d04a4
commit 3cfdb36f06
+2
View File
@@ -121,9 +121,11 @@ describe("formatRuntime", () => {
[0, ""], // nothing to show — the call sites suppress their separator on the empty string
[1, "1s"],
[45, "45s"], // one Short: the regression case
[45.7, "45s"], // truncates, so the seconds tier cannot overstate either
[59, "59s"], // last second before the minute tier
[60, "1m"],
[90, "1m"], // floors, never rounds up — a total must not overstate
[90.9, "1m"],
[3599, "59m"],
[3600, "1h 0m"], // the zero minutes stay: "1h" alone reads as an approximation
[5025, "1h 23m"],