summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2022-11-28 17:02:35 +0100
committerGitHub <noreply@github.com>2022-11-28 17:02:35 +0100
commitdc8103b67a01c0a1948176534a2c87c44ba39a0f (patch)
treeb2996691bd4cd665739c1e0ce03e772f471bb24f
parent7f0dbef196d72693f3ac69048fca6b6bb1557f91 (diff)
parent5d9cb2727061eeb2c264c6e865cf3e7b96e21d64 (diff)
Merge pull request #395 from matthiasbeyer/fix-tests-chrono
Fix: Do not use deprecated function
-rw-r--r--tests/datetime.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/datetime.rs b/tests/datetime.rs
index e15bdce..b8c64e5 100644
--- a/tests/datetime.rs
+++ b/tests/datetime.rs
@@ -86,25 +86,25 @@ fn test_datetime() {
// JSON
let date: DateTime<Utc> = s.get("json_datetime").unwrap();
- assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53));
+ assert_eq!(date, Utc.with_ymd_and_hms(2017, 5, 10, 2, 14, 53).unwrap());
// TOML
let date: DateTime<Utc> = s.get("toml_datetime").unwrap();
- assert_eq!(date, Utc.ymd(2017, 5, 11).and_hms(14, 55, 15));
+ assert_eq!(date, Utc.with_ymd_and_hms(2017, 5, 11, 14, 55, 15).unwrap());
// YAML
let date: DateTime<Utc> = s.get("yaml_datetime").unwrap();
- assert_eq!(date, Utc.ymd(2017, 6, 12).and_hms(10, 58, 30));
+ assert_eq!(date, Utc.with_ymd_and_hms(2017, 6, 12, 10, 58, 30).unwrap());
// INI
let date: DateTime<Utc> = s.get("ini_datetime").unwrap();
- assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53));
+ assert_eq!(date, Utc.with_ymd_and_hms(2017, 5, 10, 2, 14, 53).unwrap());
// RON
let date: DateTime<Utc> = s.get("ron_datetime").unwrap();
- assert_eq!(date, Utc.ymd(2021, 4, 19).and_hms(11, 33, 2));
+ assert_eq!(date, Utc.with_ymd_and_hms(2021, 4, 19, 11, 33, 2).unwrap());
}