summaryrefslogtreecommitdiffstats
path: root/vendor/chrono/src/naive/datetime/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/chrono/src/naive/datetime/tests.rs')
-rw-r--r--vendor/chrono/src/naive/datetime/tests.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/chrono/src/naive/datetime/tests.rs b/vendor/chrono/src/naive/datetime/tests.rs
index 202bdb34d..07309a48a 100644
--- a/vendor/chrono/src/naive/datetime/tests.rs
+++ b/vendor/chrono/src/naive/datetime/tests.rs
@@ -330,7 +330,7 @@ fn test_nanosecond_range() {
}
#[test]
-fn test_and_timezone() {
+fn test_and_local_timezone() {
let ndt = NaiveDate::from_ymd_opt(2022, 6, 15).unwrap().and_hms_opt(18, 59, 36).unwrap();
let dt_utc = ndt.and_local_timezone(Utc).unwrap();
assert_eq!(dt_utc.naive_local(), ndt);
@@ -341,3 +341,11 @@ fn test_and_timezone() {
assert_eq!(dt_offset.naive_local(), ndt);
assert_eq!(dt_offset.timezone(), offset_tz);
}
+
+#[test]
+fn test_and_utc() {
+ let ndt = NaiveDate::from_ymd_opt(2023, 1, 30).unwrap().and_hms_opt(19, 32, 33).unwrap();
+ let dt_utc = ndt.and_utc();
+ assert_eq!(dt_utc.naive_local(), ndt);
+ assert_eq!(dt_utc.timezone(), Utc);
+}