diff options
author | saber.wu <saber.wu@trantect.com> | 2018-06-14 17:09:43 +0800 |
---|---|---|
committer | saber.wu <saber.wu@trantect.com> | 2018-06-15 11:13:53 +0800 |
commit | ba6014543dfb4040921bb4809c6b293cfdf33c84 (patch) | |
tree | 523708c74eb31e5c861c7e474f092fafbd416879 /tests/datetime.rs | |
parent | e8fa9fee96185ddd18ebcef8a925c75459111edb (diff) |
support ini
Diffstat (limited to 'tests/datetime.rs')
-rw-r--r-- | tests/datetime.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/datetime.rs b/tests/datetime.rs index 89a34a1..26b395d 100644 --- a/tests/datetime.rs +++ b/tests/datetime.rs @@ -38,6 +38,13 @@ fn make() -> Config { FileFormat::Hjson, )) .unwrap() + .merge(File::from_str( + r#" + ini_datetime = 2017-05-10T02:14:53Z + "#, + FileFormat::Ini, + )) + .unwrap() .clone() } @@ -64,6 +71,11 @@ fn test_datetime_string() { let date: String = s.get("hjson_datetime").unwrap(); assert_eq!(&date, "2017-05-10T02:14:53Z"); + + // INI + let date: String = s.get("ini_datetime").unwrap(); + + assert_eq!(&date, "2017-05-10T02:14:53Z"); } #[test] @@ -89,4 +101,9 @@ fn test_datetime() { let date: DateTime<Utc> = s.get("hjson_datetime").unwrap(); assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53)); + + // INI + let date: DateTime<Utc> = s.get("ini_datetime").unwrap(); + + assert_eq!(date, Utc.ymd(2017, 5, 10).and_hms(2, 14, 53)); } |