mirror of
https://github.com/modrinth/code.git
synced 2026-09-01 12:36:44 +00:00
phoenix TZ
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#![expect(missing_docs, reason = "test crate")]
|
||||
|
||||
use aditude::{Client, mock::AditudeMock, v1, v2};
|
||||
use chrono::{DateTime, Utc};
|
||||
use chrono::{DateTime, NaiveDate, TimeZone, Utc};
|
||||
use rust_decimal::dec;
|
||||
|
||||
#[tokio::test]
|
||||
@@ -115,3 +115,31 @@ async fn test_yesterday() {
|
||||
|
||||
assert_eq!(real_yesterday, our_yesterday);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn phoenix_day_boundaries() {
|
||||
let august_19 = NaiveDate::from_ymd_opt(2026, 8, 19).unwrap();
|
||||
assert_eq!(
|
||||
aditude::phoenix_midnight(august_19),
|
||||
Utc.with_ymd_and_hms(2026, 8, 19, 7, 0, 0).unwrap(),
|
||||
);
|
||||
|
||||
let before_phoenix_midnight =
|
||||
Utc.with_ymd_and_hms(2026, 8, 20, 6, 59, 59).unwrap();
|
||||
assert_eq!(
|
||||
aditude::yesterday(before_phoenix_midnight),
|
||||
(
|
||||
Utc.with_ymd_and_hms(2026, 8, 18, 7, 0, 0).unwrap(),
|
||||
Utc.with_ymd_and_hms(2026, 8, 19, 7, 0, 0).unwrap(),
|
||||
),
|
||||
);
|
||||
|
||||
let phoenix_midnight = Utc.with_ymd_and_hms(2026, 8, 20, 7, 0, 0).unwrap();
|
||||
assert_eq!(
|
||||
aditude::yesterday(phoenix_midnight),
|
||||
(
|
||||
Utc.with_ymd_and_hms(2026, 8, 19, 7, 0, 0).unwrap(),
|
||||
Utc.with_ymd_and_hms(2026, 8, 20, 7, 0, 0).unwrap(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user