diff --git a/lib/src/sql/datetime.rs b/lib/src/sql/datetime.rs index a4bd471e..cd6871b9 100644 --- a/lib/src/sql/datetime.rs +++ b/lib/src/sql/datetime.rs @@ -307,6 +307,24 @@ mod tests { assert_eq!("'2012-04-24T02:55:43.511Z'", format!("{}", out)); } + #[test] + fn date_time_timezone_utc_nanoseconds() { + let sql = "2012-04-23T18:25:43.5110000Z"; + let res = datetime_raw(sql); + assert!(res.is_ok()); + let out = res.unwrap().1; + assert_eq!("'2012-04-23T18:25:43.511Z'", format!("{}", out)); + } + + #[test] + fn date_time_timezone_utc_sub_nanoseconds() { + let sql = "2012-04-23T18:25:43.0000511Z"; + let res = datetime_raw(sql); + assert!(res.is_ok()); + let out = res.unwrap().1; + assert_eq!("'2012-04-23T18:25:43.000051100Z'", format!("{}", out)); + } + #[test] fn date_time_illegal_date() { // Hey! There's not a 31st of November!