Add snapshot test of Date add/until
We have some hand-written tests, but I would like to have more thorough tests that check the whole space, to make sure that any changes to the algorithm, such as #7077, don't change the resulting behavior.
I wonder if we could leverage the Arbitrary impls from #7206 to assist in this.
What I had in mind was a more comprehensive coverage test for a certain range of dates and durations. For example:
- Every date between 2000-01-01 and 2004-12-31 (1826 days)
- Durations as follows:
- -P65D through P65D (131 durations)
- -P30M through P30M (61 durations)
- -P30M1D through P30M1D (61 durations)
- -P10Y through P10Y (21 durations)
- -P10Y1M through P10Y1M (21 durations)
- -P10Y1D through P10Y1D (21 durations)
- -P10Y1M1D through P10Y1M1D (21 durations)
Across 18 calendars, this results in: 18 * 1826 * 337 = 11,076,516 tests.
If that's too many tests, I'm okay reducing the number of dates, but I want to make sure that we cover leap days and leap months in every calendar.
Open to suggestions.
This issue isn't fixed; the linked PR added some infrastructure but not comprehensive coverage.
Thanks for the update. I can continue working on the remaining coverage if needed. Please let me know what additional cases should be tested or fixed.
@SATVIKsynopsis I gave some suggestions in https://github.com/unicode-org/icu4x/issues/7215#issuecomment-3539458618.
Sure, I will work on those suggestions and make a PR soon.