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 4, 2024
1 parent 3058c33 commit 9cc4572
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/datetime/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,17 @@ 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.
// 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 9cc4572

Please sign in to comment.