Skip to content

Commit

Permalink
Add test for issue 651
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Feb 7, 2024
1 parent 03ad2fa commit 846a6ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/datetime/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,18 @@ fn test_datetime_from_timestamp_millis() {
);
}

#[test]
#[cfg(feature = "clock")]
fn test_datetime_before_windows_api_limits() {
// dt corresponds to `FILETIME = 147221225472` from issue 651.
// (https://github.com/chronotope/chrono/issues/651)
// This used to fail on Windows for timezones with an offset of -5:00 or greater.
// The API limits years to 1601..=30827.
let dt = NaiveDate::from_ymd_opt(1601, 1, 1).unwrap().and_hms_milli_opt(4, 5, 22, 122).unwrap();
let local_dt = Local.from_utc_datetime(&dt);
dbg!(local_dt);
}

#[test]
#[cfg(feature = "clock")]
fn test_years_elapsed() {
Expand Down

0 comments on commit 846a6ff

Please sign in to comment.