feat: add compact progress decimal
This commit is contained in:
@@ -33,9 +33,10 @@ struct SystemPlaybackChecks {
|
||||
require(compactProgressText(position: position, duration: duration, format: .time) == expected,
|
||||
"compact time uses total-duration units, truncation and bounded progress: \(expected)")
|
||||
}
|
||||
for (position, expected) in [(59.9, "59"), (100.0, "100"), (105.0, "100"), (-1.0, "0")] {
|
||||
for (position, expected) in [(59.9, "59.9"), (59.99, "59.9"), (0.0, "0.0"),
|
||||
(100.0, "100.0"), (105.0, "100.0"), (-1.0, "0.0")] {
|
||||
require(compactProgressText(position: position, duration: 100, format: .percentage) == expected,
|
||||
"compact percentage is a bounded integer: \(expected)")
|
||||
"compact percentage has one decimal and stays bounded: \(expected)")
|
||||
}
|
||||
for duration in [0.0, -1.0, .nan, .infinity] {
|
||||
require(compactProgressText(position: 10, duration: duration, format: .time) == nil &&
|
||||
|
||||
Reference in New Issue
Block a user