diff --git a/src/datetime/tests.rs b/src/datetime/tests.rs index aff9d93763..8e1877c50e 100644 --- a/src/datetime/tests.rs +++ b/src/datetime/tests.rs @@ -950,38 +950,3 @@ fn test_datetime_sub_assign_local() { assert_eq!(datetime_sub, datetime - Duration::days(i)) } } - -#[test] -#[cfg(target_os = "windows")] -fn test_from_naive_date_time_windows() { - let min_year = NaiveDate::from_ymd_opt(1601, 1, 3).unwrap().and_hms_opt(0, 0, 0).unwrap(); - - let max_year = NaiveDate::from_ymd_opt(30827, 12, 29).unwrap().and_hms_opt(23, 59, 59).unwrap(); - - let too_low_year = - NaiveDate::from_ymd_opt(1600, 12, 29).unwrap().and_hms_opt(23, 59, 59).unwrap(); - - let too_high_year = NaiveDate::from_ymd_opt(30829, 1, 3).unwrap().and_hms_opt(0, 0, 0).unwrap(); - - let _ = Local.from_utc_datetime(&min_year); - let _ = Local.from_utc_datetime(&max_year); - - let _ = Local.from_local_datetime(&min_year); - let _ = Local.from_local_datetime(&max_year); - - let local_too_low = Local.from_local_datetime(&too_low_year); - let local_too_high = Local.from_local_datetime(&too_high_year); - - assert_eq!(local_too_low, LocalResult::None); - assert_eq!(local_too_high, LocalResult::None); - - let err = std::panic::catch_unwind(|| { - Local.from_utc_datetime(&too_low_year); - }); - assert!(err.is_err()); - - let err = std::panic::catch_unwind(|| { - Local.from_utc_datetime(&too_high_year); - }); - assert!(err.is_err()); -}