diff --git a/CHANGELOG.md b/CHANGELOG.md index bef5b54..3ab25df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # DevTesting Changelog +## 1.5.0: October 22, 2025 + +The `Date.random(in:using:)` functions now use `BinaryFloatingPoint.randomPrintable(in:using:)` to +generate time intervals. This should lead to greater reliability when converting the time intervals +of generated dates into strings. + + ## 1.4.0: October 12, 2025 `Stub` and `ThrowingStub` now conform to `Observable`. The only property that is tracked is diff --git a/Sources/DevTesting/Random Value Generation/Date+Random.swift b/Sources/DevTesting/Random Value Generation/Date+Random.swift index c0c8c68..7425ca5 100644 --- a/Sources/DevTesting/Random Value Generation/Date+Random.swift +++ b/Sources/DevTesting/Random Value Generation/Date+Random.swift @@ -21,7 +21,7 @@ extension Date { let lowerBound = range.lowerBound.timeIntervalSinceReferenceDate let upperBound = range.upperBound.timeIntervalSinceReferenceDate return Date( - timeIntervalSinceReferenceDate: .random( + timeIntervalSinceReferenceDate: .randomPrintable( in: lowerBound ..< upperBound, using: &generator ) @@ -42,7 +42,7 @@ extension Date { let lowerBound = range.lowerBound.timeIntervalSinceReferenceDate let upperBound = range.upperBound.timeIntervalSinceReferenceDate return Date( - timeIntervalSinceReferenceDate: .random( + timeIntervalSinceReferenceDate: .randomPrintable( in: lowerBound ... upperBound, using: &generator )