From b5a98437b4f998bd1aa0fa2efc847195e6021182 Mon Sep 17 00:00:00 2001 From: k-yomo Date: Sun, 24 Jul 2022 20:36:06 +0900 Subject: [PATCH] Fix failing nanosec truncation check on mac OS --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 671884b880..a320404bb0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1150,7 +1150,7 @@ pub mod tests { assert_eq!(dt.to_ordinal_date(), now.to_ordinal_date()); assert_eq!(dt.to_hms_micro(), now.to_hms_micro()); // We don't store nanosecond level precision. - assert_ne!(dt.to_hms_nano(), now.to_hms_nano()); + assert_eq!(dt.nanosecond(), now.microsecond() * 1000); let dt = DateTime::from_timestamp_secs(now.unix_timestamp()).into_utc(); assert_eq!(dt.to_ordinal_date(), now.to_ordinal_date());