fix: round final compact progress fraction to completion

This commit is contained in:
2026-10-17 23:08:52 +02:00
parent 2b96a165d2
commit d4704af442
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -34,6 +34,7 @@ struct SystemPlaybackChecks {
"compact time uses total-duration units, truncation and bounded progress: \(expected)")
}
for (position, expected) in [(59.9, "59.9"), (59.99, "59.9"), (0.0, "0.0"),
(99.89, "99.8"), (99.9, "100.0"), (99.99, "100.0"),
(100.0, "100.0"), (105.0, "100.0"), (-1.0, "0.0")] {
require(compactProgressText(position: position, duration: 100, format: .percentage) == expected,
"compact percentage has one decimal and stays bounded: \(expected)")