Skip to content

Commit

Permalink
Remove obsolete test
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Apr 18, 2023
1 parent c290c0f commit 8a67878
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/datetime/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

0 comments on commit 8a67878

Please sign in to comment.