Add extra tests for nanosecond and millisecond parsing
This commit is contained in:
parent
7dcb0f83fa
commit
fa0ec302ca
1 changed files with 18 additions and 0 deletions
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue