()
| 1673 | |
| 1674 | #[test] |
| 1675 | fn string_to_timestamp_naive() { |
| 1676 | let cases = [ |
| 1677 | "2018-11-13T17:11:10.011375885995", |
| 1678 | "2030-12-04T17:11:10.123", |
| 1679 | "2030-12-04T17:11:10.1234", |
| 1680 | "2030-12-04T17:11:10.123456", |
| 1681 | ]; |
| 1682 | for case in cases { |
| 1683 | let chrono = NaiveDateTime::parse_from_str(case, "%Y-%m-%dT%H:%M:%S%.f").unwrap(); |
| 1684 | let custom = string_to_datetime(&Utc, case).unwrap(); |
| 1685 | assert_eq!(chrono, custom.naive_utc()) |
| 1686 | } |
| 1687 | } |
| 1688 | |
| 1689 | #[test] |
| 1690 | fn string_to_timestamp_invalid() { |
nothing calls this directly
no test coverage detected