Correctly order earliest / latest for Ambiguous times in local TimeZone#1626
Correctly order earliest / latest for Ambiguous times in local TimeZone#1626AVee wants to merge 6 commits intochronotope:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1626 +/- ##
==========================================
+ Coverage 91.12% 91.77% +0.65%
==========================================
Files 37 37
Lines 17137 17443 +306
==========================================
+ Hits 15616 16009 +393
+ Misses 1521 1434 -87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
It's a matter of taste, be I find a list of assert_eq! statements to be clearer here.
djc
left a comment
There was a problem hiding this comment.
Thanks for working on this, the code changes look good and I appreciate the added test coverage.
| #[allow(clippy::bool_assert_comparison)] | ||
| fn test_dst_backward_tzfile() -> Result<(), Error> { | ||
| // Northern hemisphere DST (CET/CEST) | ||
| let data: [u8; 604] = [ |
There was a problem hiding this comment.
These big binary blobs are a pain to manage. What value does this test have over and above the test_dst_backward_posix_tz tests? Do these tests actually gain us any coverage?
|
Any news on this? |
|
We are working around this issue with this snippet of code: match /*...*/ {
MappedLocalTime::Ambiguous(mut earliest, mut latest) => {
// Bug in Chrono: https://github.com/chronotope/chrono/issues/1625
if earliest > latest {
std::mem::swap(&mut earliest, &mut latest);
}
// ...But it'd still be wise to make this a semver breaking change for anyone who has come to rely on the old behaviour. |
I asked a question which has not been answered. I'm not making any semver-compatible changes in the near future. |
This swaps earliest / latest in Local Timezone handling as it seems to be consistently in the incorrect order, see issue #1625 . I think I changed all places where an instance of MappedLocalTime::Ambiguous is created in the unix part of offset/local. I haven't yet looked at Windows.
I've also added some tests to cover this, which should cover most cases.