From 3cfdb36f0694ffb3670be47355c196e3b0c91892 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Thu, 3 Sep 2026 21:51:14 +0200 Subject: [PATCH] test(format): pin the sub-minute truncation (E9 R2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- frontend/src/lib/format.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/lib/format.test.ts b/frontend/src/lib/format.test.ts index 7b738568..e9d8dcb4 100644 --- a/frontend/src/lib/format.test.ts +++ b/frontend/src/lib/format.test.ts @@ -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"],