diff --git a/README.md b/README.md index 87fe892..77aca97 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,14 @@ DevTesting is a small Swift 6 package that contains useful additions for writing Testing](https://github.com/swiftlang/swift-testing/). - `SeedableRandomNumberGenerator` is a random number generator that can be seeded to enable - repeatable tests with random data. + repeatable tests with random values. - `RandomValueGenerating` uses a seedable random number generator to repeatably generate values in your test suite. It logs the seed before every test so that you can debug tests that failed. It - also includes convenient functions for generating random data: + also includes convenient functions for generating random values: - Booleans - Case iterables - Data + - Dates - Floating point types - Integer types - Optionals diff --git a/Sources/DevTesting/Documentation.docc/Documentation.md b/Sources/DevTesting/Documentation.docc/Documentation.md index 750ecd5..4953881 100644 --- a/Sources/DevTesting/Documentation.docc/Documentation.md +++ b/Sources/DevTesting/Documentation.docc/Documentation.md @@ -45,6 +45,7 @@ over how its dependencies behave and providing detailed information about how th - ``Swift/BinaryFloatingPoint`` - ``Swift/CaseIterable`` - ``Foundation/Data`` +- ``Foundation/Date`` - ``Swift/Optional`` - ``Swift/String`` - ``Foundation/URL`` diff --git a/Sources/DevTesting/Documentation.docc/RandomValueGenerating.md b/Sources/DevTesting/Documentation.docc/RandomValueGenerating.md index b3a2682..59f8fdc 100644 --- a/Sources/DevTesting/Documentation.docc/RandomValueGenerating.md +++ b/Sources/DevTesting/Documentation.docc/RandomValueGenerating.md @@ -15,6 +15,13 @@ - ``randomElement(in:)`` +### Dates + +- ``defaultClosedDateRange`` +- ``randomDate(in:)-(ClosedRange?)`` +- ``randomDate(in:)-(Range)`` + + ### Numeric Types - ``randomFloat64(in:)-(Range)`` diff --git a/Sources/DevTesting/Random Value Generation/Date+Random.swift b/Sources/DevTesting/Random Value Generation/Date+Random.swift index b9ce62d..c0c8c68 100644 --- a/Sources/DevTesting/Random Value Generation/Date+Random.swift +++ b/Sources/DevTesting/Random Value Generation/Date+Random.swift @@ -8,7 +8,7 @@ import Foundation extension Date { - /// Returns a random date in the specified range. + /// Returns a random date in the specified half-open range. /// /// - Parameters: /// - range: The closed range in which to create a random value. `range` must not be empty. @@ -29,7 +29,7 @@ extension Date { } - /// Returns a random date in the specified range. + /// Returns a random date in the specified closed range. /// /// - Parameters: /// - range: The half-open range in which to create a random value.