From 3a9e2674a67cbd065123b2d3d3fec34793b9c33c Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 25 Mar 2023 02:12:57 +0000 Subject: [PATCH 1/2] #40: Nanosecond precision --- .travis.yml | 40 ---------------------------------------- Cargo.toml | 12 ++++++------ README.md | 1 - bors.toml | 4 ---- ci/install.sh | 47 ----------------------------------------------- ci/script.sh | 40 ---------------------------------------- src/lib.rs | 24 ++++++++++++------------ src/tests/mod.rs | 11 +++++++++++ 8 files changed, 29 insertions(+), 150 deletions(-) delete mode 100644 .travis.yml delete mode 100644 bors.toml delete mode 100755 ci/install.sh delete mode 100644 ci/script.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4a92d65..0000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: rust - -jobs: - include: - - rust: stable - os: linux - - rust: 1.28.0 - os: linux - env: DISABLE_TOOLS=true - - rust: stable - os: osx - - rust: stable-msvc - os: windows - - rust: stable - os: windows - -cache: - - cargo - -before_script: - - rustup show - # CMake doesn't like the `sh.exe` provided by Git being in PATH - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then rm "C:/Program Files/Git/usr/bin/sh.exe"; fi - - if [[ "$DISABLE_TOOLS" == "" ]]; then rustup component add clippy; rustup component add rustfmt; fi - -script: - - if [[ "$DISABLE_TOOLS" == "" ]]; then cargo clippy --all && cargo fmt --all -- --check; fi - - # For default build, split up compilation and tests so we can track build times - - cargo test --no-run - - cargo test - - cargo test --release --no-run - - cargo test --release - -branches: - only: - - master - - staging - - trying - diff --git a/Cargo.toml b/Cargo.toml index 3b9e00d..9b603a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dtparse" -version = "1.3.0" +version = "1.4.0" authors = ["Bradlee Speice "] description = "A dateutil-compatible timestamp parser for Rust" repository = "https://github.com/bspeice/dtparse.git" @@ -16,10 +16,10 @@ maintenance = { status = "passively-maintained" } name = "dtparse" [dependencies] -chrono = "0.4" -lazy_static = "1.1" -num-traits = "0.2" -rust_decimal = { version = "1.17.0", default-features = false } +chrono = "0.4.24" +lazy_static = "1.4.0" +num-traits = "0.2.15" +rust_decimal = { version = "1.29.1", default-features = false } [dev-dependencies] -base64 = "0.13" +base64 = "0.21.0" diff --git a/README.md b/README.md index 8dbe81a..822f9ee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # dtparse -[![travisci](https://travis-ci.org/bspeice/dtparse.svg?branch=master)](https://travis-ci.org/bspeice/dtparse) [![crates.io](https://img.shields.io/crates/v/dtparse.svg)](https://crates.io/crates/dtparse) [![docs.rs](https://docs.rs/dtparse/badge.svg)](https://docs.rs/dtparse/) diff --git a/bors.toml b/bors.toml deleted file mode 100644 index c1605d2..0000000 --- a/bors.toml +++ /dev/null @@ -1,4 +0,0 @@ -status = [ - "continuous-integration/travis-ci/push", -] -delete_merged_branches = true \ No newline at end of file diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100755 index 80e18e4..0000000 --- a/ci/install.sh +++ /dev/null @@ -1,47 +0,0 @@ -set -ex - -main() { - local target= - if [ $TRAVIS_OS_NAME = linux ]; then - target=x86_64-unknown-linux-musl - sort=sort - else - target=x86_64-apple-darwin - sort=gsort # for `sort --sort-version`, from brew's coreutils. - fi - - # Builds for iOS are done on OSX, but require the specific target to be - # installed. - case $TARGET in - aarch64-apple-ios) - rustup target install aarch64-apple-ios - ;; - armv7-apple-ios) - rustup target install armv7-apple-ios - ;; - armv7s-apple-ios) - rustup target install armv7s-apple-ios - ;; - i386-apple-ios) - rustup target install i386-apple-ios - ;; - x86_64-apple-ios) - rustup target install x86_64-apple-ios - ;; - esac - - # This fetches latest stable release - local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \ - | cut -d/ -f3 \ - | grep -E '^v[0.1.0-9.]+$' \ - | $sort --version-sort \ - | tail -n1) - curl -LSfs https://japaric.github.io/trust/install.sh | \ - sh -s -- \ - --force \ - --git japaric/cross \ - --tag $tag \ - --target $target -} - -main diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100644 index 4c501e0..0000000 --- a/ci/script.sh +++ /dev/null @@ -1,40 +0,0 @@ -# This script takes care of testing your crate - -set -ex - -main() { - cross build --target $TARGET - cross build --target $TARGET --release - - if [ ! -z $DISABLE_TESTS ]; then - return - fi - - cross test --target $TARGET - cross test --target $TARGET --release -} - -main_web() { - CARGO_WEB_RELEASE="$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest)" - CARGO_WEB_VERSION="$(echo $CARGO_WEB_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')" - CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/$CARGO_WEB_VERSION/cargo-web-x86_64-unknown-linux-gnu.gz" - - echo "Downloading cargo-web from: $CARGO_WEB_URL" - curl -L "$CARGO_WEB_URL" | gzip -d > cargo-web - chmod +x cargo-web - - mkdir -p ~/.cargo/bin - mv cargo-web ~/.cargo/bin - - cargo web build --target $TARGET - cargo web test --target $TARGET --release -} - -# we don't run the "test phase" when doing deploys -if [ -z $TRAVIS_TAG ]; then - if [ -z "$USE_CARGO_WEB" ]; then - main - else - main_web - fi -fi diff --git a/src/lib.rs b/src/lib.rs index 9f4dd7b..2cf1dba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -617,7 +617,7 @@ struct ParsingResult { hour: Option, minute: Option, second: Option, - microsecond: Option, + nanosecond: Option, tzname: Option, tzoffset: Option, ampm: Option, @@ -644,7 +644,7 @@ impl ParsingResult { + option_len!(self.hour) + option_len!(self.minute) + option_len!(self.second) - + option_len!(self.microsecond) + + option_len!(self.nanosecond) + option_len!(self.tzname) + option_len!(self.ampm) } @@ -976,18 +976,18 @@ impl Parser { let hour = res.hour.unwrap_or(default.hour() as i32) as u32; let minute = res.minute.unwrap_or(default.minute() as i32) as u32; let second = res.second.unwrap_or(default.second() as i32) as u32; - let microsecond = res - .microsecond - .unwrap_or(default.timestamp_subsec_micros() as i32) as u32; + let nanosecond = res + .nanosecond + .unwrap_or(default.timestamp_subsec_nanos() as i64) as u32; let t = - NaiveTime::from_hms_micro_opt(hour, minute, second, microsecond).ok_or_else(|| { + NaiveTime::from_hms_nano_opt(hour, minute, second, nanosecond).ok_or_else(|| { if hour >= 24 { ParseError::ImpossibleTimestamp("Invalid hour") } else if minute >= 60 { ParseError::ImpossibleTimestamp("Invalid minute") } else if second >= 60 { ParseError::ImpossibleTimestamp("Invalid second") - } else if microsecond >= 2_000_000 { + } else if nanosecond >= 2_000_000_000 { ParseError::ImpossibleTimestamp("Invalid microsecond") } else { unreachable!(); @@ -1071,7 +1071,7 @@ impl Parser { let t = self.parsems(&s[4..])?; res.second = Some(t.0); - res.microsecond = Some(t.1); + res.nanosecond = Some(t.1); } } else if vec![8, 12, 14].contains(&len_li) { // YYMMDD @@ -1109,7 +1109,7 @@ impl Parser { // TODO: (x, y) = (a, b) syntax? let ms = self.parsems(&tokens[idx + 4]).unwrap(); res.second = Some(ms.0); - res.microsecond = Some(ms.1); + res.nanosecond = Some(ms.1); idx += 2; } @@ -1183,13 +1183,13 @@ impl Parser { } } - fn parsems(&self, seconds_str: &str) -> ParseResult<(i32, i32)> { + fn parsems(&self, seconds_str: &str) -> ParseResult<(i32, i64)> { if seconds_str.contains('.') { let split: Vec<&str> = seconds_str.split('.').collect(); let (i, f): (&str, &str) = (split[0], split[1]); let i_parse = i.parse::()?; - let f_parse = ljust(f, 6, '0').parse::()?; + let f_parse = ljust(f, 9, '0').parse::()?; Ok((i_parse, f_parse)) } else { Ok((seconds_str.parse::()?, 0)) @@ -1281,7 +1281,7 @@ impl Parser { } else if hms == 2 { let (sec, micro) = self.parsems(value_repr).unwrap(); res.second = Some(sec); - res.microsecond = Some(micro); + res.nanosecond = Some(micro); } Ok(()) diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 1776124..6dc10bb 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -1,3 +1,14 @@ mod fuzzing; mod pycompat_parser; mod pycompat_tokenizer; + +use chrono::NaiveDate; +use crate::parse; + +#[test] +fn nanosecond_precision() { + assert_eq!( + parse("2008.12.29T08:09:10.123456789").unwrap(), + (NaiveDate::from_ymd_opt(2008, 12, 29).unwrap().and_hms_nano_opt(8, 9, 10, 123_456_789).unwrap(), None) + ) +} \ No newline at end of file From b925b968ca48ca15ff977a0c68347e157111ccb6 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 25 Mar 2023 02:29:55 +0000 Subject: [PATCH 2/2] Fix deprecations --- build_pycompat.py | 6 +- examples/russian.rs | 2 +- src/lib.rs | 11 +- src/tests/fuzzing.rs | 10 +- src/tests/pycompat_parser.rs | 3215 ++++++++-------------------------- 5 files changed, 750 insertions(+), 2494 deletions(-) diff --git a/build_pycompat.py b/build_pycompat.py index 8886d21..a54b1ce 100755 --- a/build_pycompat.py +++ b/build_pycompat.py @@ -317,7 +317,7 @@ TEST_PARSE_DEFAULT = ''' #[test] fn test_parse_default{i}() {{ let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime {{ year: {d.year}, month: {d.month}, day: {d.day}, hour: {d.hour}, minute: {d.minute}, second: {d.second}, @@ -407,7 +407,7 @@ TEST_UNSPECIFIED_FALLBACK = ''' #[test] fn test_unspecified_fallback{i}() {{ let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2010, 1, 31).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2010, 1, 31).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime {{ year: {d.year}, month: {d.month}, day: {d.day}, hour: {d.hour}, minute: {d.minute}, second: {d.second}, @@ -435,7 +435,7 @@ TEST_PARSE_DEFAULT_IGNORE = ''' #[ignore] fn test_parse_default_ignore{i}() {{ let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime {{ year: {d.year}, month: {d.month}, day: {d.day}, hour: {d.hour}, minute: {d.minute}, second: {d.second}, diff --git a/examples/russian.rs b/examples/russian.rs index ba81a49..da03116 100644 --- a/examples/russian.rs +++ b/examples/russian.rs @@ -43,6 +43,6 @@ fn main() { ) .unwrap() .0, - NaiveDate::from_ymd(2015, 9, 10).and_hms(10, 20, 0) + NaiveDate::from_ymd_opt(2015, 9, 10).unwrap().and_hms_opt(10, 20, 0).unwrap() ); } diff --git a/src/lib.rs b/src/lib.rs index 2cf1dba..723148d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,6 +77,9 @@ extern crate chrono; extern crate num_traits; extern crate rust_decimal; +#[cfg(test)] +extern crate base64; + use chrono::Datelike; use chrono::Duration; use chrono::FixedOffset; @@ -712,7 +715,7 @@ impl Parser { ) -> ParseResult<(NaiveDateTime, Option, Option>)> { let default_date = default.unwrap_or(&Local::now().naive_local()).date(); - let default_ts = NaiveDateTime::new(default_date, NaiveTime::from_hms(0, 0, 0)); + let default_ts = NaiveDateTime::new(default_date, NaiveTime::from_hms_opt(0, 0, 0).unwrap()); let (res, tokens) = self.parse_with_tokens(timestr, dayfirst, yearfirst, fuzzy, fuzzy_with_tokens)?; @@ -1004,7 +1007,7 @@ impl Parser { tzinfos: &HashMap, ) -> ParseResult> { if let Some(offset) = res.tzoffset { - Ok(Some(FixedOffset::east(offset))) + Ok(FixedOffset::east_opt(offset)) } else if res.tzoffset == None && (res.tzname == Some(" ".to_owned()) || res.tzname == Some(".".to_owned()) @@ -1013,9 +1016,9 @@ impl Parser { { Ok(None) } else if res.tzname.is_some() && tzinfos.contains_key(res.tzname.as_ref().unwrap()) { - Ok(Some(FixedOffset::east( + Ok(FixedOffset::east_opt( *tzinfos.get(res.tzname.as_ref().unwrap()).unwrap(), - ))) + )) } else if let Some(tzname) = res.tzname.as_ref() { println!("tzname {} identified but not understood.", tzname); Ok(None) diff --git a/src/tests/fuzzing.rs b/src/tests/fuzzing.rs index 383c183..55befea 100644 --- a/src/tests/fuzzing.rs +++ b/src/tests/fuzzing.rs @@ -1,3 +1,5 @@ +use base64::Engine; +use base64::engine::general_purpose::STANDARD; use chrono::NaiveDate; use std::collections::HashMap; use std::str; @@ -19,7 +21,7 @@ fn test_fuzz() { Err(ParseError::UnrecognizedFormat) ); - let default = NaiveDate::from_ymd(2016, 6, 29).and_hms(0, 0, 0); + let default = NaiveDate::from_ymd_opt(2016, 6, 29).unwrap().and_hms_opt(0, 0, 0).unwrap(); let p = Parser::default(); let res = p.parse( "\x0D\x31", @@ -74,7 +76,7 @@ fn github_32() { #[test] fn github_34() { - let parse_vec = base64::decode("KTMuLjYpGDYvLjZTNiouNjYuHzZpLjY/NkwuNh42Ry42PzYnKTMuNk02NjY2NjA2NjY2NjY2NjYTNjY2Ni82NjY2NlAuNlAuNlNI").unwrap(); + let parse_vec = STANDARD.decode("KTMuLjYpGDYvLjZTNiouNjYuHzZpLjY/NkwuNh42Ry42PzYnKTMuNk02NjY2NjA2NjY2NjY2NjYTNjY2Ni82NjY2NlAuNlAuNlNI").unwrap(); let parse_str = str::from_utf8(&parse_vec).unwrap(); let parse_result = parse(parse_str); assert!(parse_result.is_err()); @@ -82,7 +84,7 @@ fn github_34() { #[test] fn github_35() { - let parse_vec = base64::decode("KTY6LjYqNio6KjYn").unwrap(); + let parse_vec = STANDARD.decode("KTY6LjYqNio6KjYn").unwrap(); let parse_str = str::from_utf8(&parse_vec).unwrap(); let parse_result = parse(parse_str); assert!(parse_result.is_err()); @@ -90,7 +92,7 @@ fn github_35() { #[test] fn github_36() { - let parse_vec = base64::decode("KTYuLg==").unwrap(); + let parse_vec = STANDARD.decode("KTYuLg==").unwrap(); let parse_str = str::from_utf8(&parse_vec).unwrap(); let parse_result = parse(parse_str); assert!(parse_result.is_err()); diff --git a/src/tests/pycompat_parser.rs b/src/tests/pycompat_parser.rs index 444eb53..a6542a9 100644 --- a/src/tests/pycompat_parser.rs +++ b/src/tests/pycompat_parser.rs @@ -1,3 +1,4 @@ + //! This code has been generated by running the `build_pycompat.py` script //! in the repository root. Please do not edit it, as your edits will be destroyed //! upon re-running code generation. @@ -10,9 +11,9 @@ use chrono::NaiveDateTime; use chrono::Timelike; use std::collections::HashMap; -use parse; use Parser; use ParserInfo; +use parse; struct PyDateTime { year: i32, @@ -22,7 +23,7 @@ struct PyDateTime { minute: u32, second: u32, micros: u32, - tzo: Option, + tzo: Option } fn parse_and_assert( @@ -37,80 +38,41 @@ fn parse_and_assert( ignoretz: bool, tzinfos: &HashMap, ) { + let parser = Parser::new(info); - let rs_parsed = parser - .parse( - s, - dayfirst, - yearfirst, - fuzzy, - fuzzy_with_tokens, - default, - ignoretz, - tzinfos, - ) - .expect(&format!("Unable to parse date in Rust '{}'", s)); + let rs_parsed = parser.parse( + s, + dayfirst, + yearfirst, + fuzzy, + fuzzy_with_tokens, + default, + ignoretz, + tzinfos).expect(&format!("Unable to parse date in Rust '{}'", s)); assert_eq!(pdt.year, rs_parsed.0.year(), "Year mismatch for '{}'", s); assert_eq!(pdt.month, rs_parsed.0.month(), "Month mismatch for '{}'", s); assert_eq!(pdt.day, rs_parsed.0.day(), "Day mismatch for '{}'", s); assert_eq!(pdt.hour, rs_parsed.0.hour(), "Hour mismatch for '{}'", s); - assert_eq!( - pdt.minute, - rs_parsed.0.minute(), - "Minute mismatch f'or' {}", - s - ); - assert_eq!( - pdt.second, - rs_parsed.0.second(), - "Second mismatch for '{}'", - s - ); - assert_eq!( - pdt.micros, - rs_parsed.0.timestamp_subsec_micros(), - "Microsecond mismatch for '{}'", - s - ); - assert_eq!( - pdt.tzo, - rs_parsed.1.map(|u| u.local_minus_utc()), - "Timezone Offset mismatch for '{}'", - s - ); + assert_eq!(pdt.minute, rs_parsed.0.minute(), "Minute mismatch f'or' {}", s); + assert_eq!(pdt.second, rs_parsed.0.second(), "Second mismatch for '{}'", s); + assert_eq!(pdt.micros, rs_parsed.0.timestamp_subsec_micros(), "Microsecond mismatch for '{}'", s); + assert_eq!(pdt.tzo, rs_parsed.1.map(|u| u.local_minus_utc()), "Timezone Offset mismatch for '{}'", s); } -fn parse_and_assert_simple(pdt: PyDateTime, s: &str) { +fn parse_and_assert_simple( + pdt: PyDateTime, + s: &str, +) { let rs_parsed = parse(s).expect(&format!("Unable to parse date in Rust '{}'", s)); assert_eq!(pdt.year, rs_parsed.0.year(), "Year mismatch for '{}'", s); assert_eq!(pdt.month, rs_parsed.0.month(), "Month mismatch for '{}'", s); assert_eq!(pdt.day, rs_parsed.0.day(), "Day mismatch for '{}'", s); assert_eq!(pdt.hour, rs_parsed.0.hour(), "Hour mismatch for '{}'", s); - assert_eq!( - pdt.minute, - rs_parsed.0.minute(), - "Minute mismatch for '{}'", - s - ); - assert_eq!( - pdt.second, - rs_parsed.0.second(), - "Second mismatch for '{}'", - s - ); - assert_eq!( - pdt.micros, - rs_parsed.0.timestamp_subsec_micros(), - "Microsecond mismatch for '{}'", - s - ); - assert_eq!( - pdt.tzo, - rs_parsed.1.map(|u| u.local_minus_utc()), - "Timezone Offset mismatch for '{}'", - s - ); + assert_eq!(pdt.minute, rs_parsed.0.minute(), "Minute mismatch for '{}'", s); + assert_eq!(pdt.second, rs_parsed.0.second(), "Second mismatch for '{}'", s); + assert_eq!(pdt.micros, rs_parsed.0.timestamp_subsec_micros(), "Microsecond mismatch for '{}'", s); + assert_eq!(pdt.tzo, rs_parsed.1.map(|u| u.local_minus_utc()), "Timezone Offset mismatch for '{}'", s); } fn parse_fuzzy_and_assert( @@ -126,1386 +88,654 @@ fn parse_fuzzy_and_assert( ignoretz: bool, tzinfos: &HashMap, ) { + let parser = Parser::new(info); - let rs_parsed = parser - .parse( - s, - dayfirst, - yearfirst, - fuzzy, - fuzzy_with_tokens, - default, - ignoretz, - tzinfos, - ) - .expect(&format!("Unable to parse date in Rust '{}'", s)); + let rs_parsed = parser.parse( + s, + dayfirst, + yearfirst, + fuzzy, + fuzzy_with_tokens, + default, + ignoretz, + tzinfos).expect(&format!("Unable to parse date in Rust '{}'", s)); assert_eq!(pdt.year, rs_parsed.0.year(), "Year mismatch for '{}'", s); assert_eq!(pdt.month, rs_parsed.0.month(), "Month mismatch for '{}'", s); assert_eq!(pdt.day, rs_parsed.0.day(), "Day mismatch for '{}'", s); assert_eq!(pdt.hour, rs_parsed.0.hour(), "Hour mismatch for '{}'", s); - assert_eq!( - pdt.minute, - rs_parsed.0.minute(), - "Minute mismatch f'or' {}", - s - ); - assert_eq!( - pdt.second, - rs_parsed.0.second(), - "Second mismatch for '{}'", - s - ); - assert_eq!( - pdt.micros, - rs_parsed.0.timestamp_subsec_micros(), - "Microsecond mismatch for '{}'", - s - ); - assert_eq!( - pdt.tzo, - rs_parsed.1.map(|u| u.local_minus_utc()), - "Timezone Offset mismatch for '{}'", - s - ); + assert_eq!(pdt.minute, rs_parsed.0.minute(), "Minute mismatch f'or' {}", s); + assert_eq!(pdt.second, rs_parsed.0.second(), "Second mismatch for '{}'", s); + assert_eq!(pdt.micros, rs_parsed.0.timestamp_subsec_micros(), "Microsecond mismatch for '{}'", s); + assert_eq!(pdt.tzo, rs_parsed.1.map(|u| u.local_minus_utc()), "Timezone Offset mismatch for '{}'", s); assert_eq!(ptokens, rs_parsed.2, "Tokens mismatch for '{}'", s); } macro_rules! rs_tzinfo_map { - () => {{ + () => ({ let mut h = HashMap::new(); h.insert("BRST".to_owned(), -10800); h - }}; + }); } #[test] fn test_parse_default0() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Thu Sep 25 10:36:28", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Thu Sep 25 10:36:28", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default1() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Sep 10:36:28", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Sep 10:36:28", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default2() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:36:28", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:36:28", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default3() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:36", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:36", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default4() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Sep 2003", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Sep 2003", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default5() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Sep", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Sep", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default6() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "2003", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2003", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default7() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 500000, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 500000, tzo: None }; - parse_and_assert( - pdt, - info, - "10h36m28.5s", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10h36m28.5s", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default8() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10h36m28s", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10h36m28s", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default9() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10h36m", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10h36m", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default10() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10h", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10h", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default11() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10 h 36", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10 h 36", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default12() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 30, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 30, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10 h 36.5", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10 h 36.5", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default13() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 36, - second: 5, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 36, second: 5, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "36 m 5", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "36 m 5", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default14() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 36, - second: 5, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 36, second: 5, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "36 m 5 s", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "36 m 5 s", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default15() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 36, - second: 5, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 36, second: 5, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "36 m 05", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "36 m 05", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default16() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 36, - second: 5, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 36, second: 5, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "36 m 05 s", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "36 m 05 s", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default17() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10h am", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10h am", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default18() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 22, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 22, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10h pm", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10h pm", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default19() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10am", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10am", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default20() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 22, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 22, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10pm", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10pm", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default21() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00 am", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00 am", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default22() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 22, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 22, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00 pm", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00 pm", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default23() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00am", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00am", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default24() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 22, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 22, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00pm", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00pm", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default25() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00a.m", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00a.m", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default26() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 22, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 22, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00p.m", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00p.m", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default27() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00a.m.", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00a.m.", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default28() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 22, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 22, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "10:00p.m.", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10:00p.m.", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default29() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 10, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "October", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "October", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default30() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2000, - month: 12, - day: 31, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2000, month: 12, day: 31, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "31-Dec-00", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "31-Dec-00", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default31() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "0:01:02", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "0:01:02", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default32() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "12h 01m02s am", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "12h 01m02s am", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default33() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 12, - minute: 8, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 12, minute: 8, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "12:08 PM", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "12:08 PM", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default34() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 1, - minute: 2, - second: 3, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 1, minute: 2, second: 3, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "01h02m03", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "01h02m03", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default35() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 1, - minute: 2, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 1, minute: 2, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "01h02", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "01h02", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default36() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 1, - minute: 0, - second: 2, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 1, minute: 0, second: 2, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "01h02s", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "01h02s", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default37() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "01m02", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "01m02", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default38() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 2, - minute: 1, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 2, minute: 1, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "01m02h", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "01m02h", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default39() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2004, - month: 4, - day: 10, - hour: 11, - minute: 30, - second: 0, - micros: 0, - tzo: None, + year: 2004, month: 4, day: 10, + hour: 11, minute: 30, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "2004 10 Apr 11h30m", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2004 10 Apr 11h30m", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default40() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Sep 03", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Sep 03", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default41() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Sep of 03", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Sep of 03", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default42() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2017, - month: 11, - day: 25, - hour: 2, - minute: 17, - second: 0, - micros: 0, - tzo: None, + year: 2017, month: 11, day: 25, + hour: 2, minute: 17, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "02:17NOV2017", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "02:17NOV2017", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default43() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Thu Sep 10:36:28", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Thu Sep 10:36:28", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default44() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Thu 10:36:28", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Thu 10:36:28", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default45() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 10, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Wed", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Wed", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_default46() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2003, 9, 25).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2003, 9, 25).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2003, - month: 10, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Wednesday", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Wednesday", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_simple0() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "Thu Sep 25 10:36:28 2003"); } @@ -1513,14 +743,9 @@ fn test_parse_simple0() { #[test] fn test_parse_simple1() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "Thu Sep 25 2003"); } @@ -1528,14 +753,9 @@ fn test_parse_simple1() { #[test] fn test_parse_simple2() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003-09-25T10:49:41"); } @@ -1543,14 +763,9 @@ fn test_parse_simple2() { #[test] fn test_parse_simple3() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003-09-25T10:49"); } @@ -1558,14 +773,9 @@ fn test_parse_simple3() { #[test] fn test_parse_simple4() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003-09-25T10"); } @@ -1573,14 +783,9 @@ fn test_parse_simple4() { #[test] fn test_parse_simple5() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003-09-25"); } @@ -1588,14 +793,9 @@ fn test_parse_simple5() { #[test] fn test_parse_simple6() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "20030925T104941"); } @@ -1603,14 +803,9 @@ fn test_parse_simple6() { #[test] fn test_parse_simple7() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "20030925T1049"); } @@ -1618,14 +813,9 @@ fn test_parse_simple7() { #[test] fn test_parse_simple8() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "20030925T10"); } @@ -1633,14 +823,9 @@ fn test_parse_simple8() { #[test] fn test_parse_simple9() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "20030925"); } @@ -1648,14 +833,9 @@ fn test_parse_simple9() { #[test] fn test_parse_simple10() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 502000, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 502000, tzo: None, }; parse_and_assert_simple(pdt, "2003-09-25 10:49:41,502"); } @@ -1663,14 +843,9 @@ fn test_parse_simple10() { #[test] fn test_parse_simple11() { let pdt = PyDateTime { - year: 1997, - month: 9, - day: 2, - hour: 9, - minute: 8, - second: 0, - micros: 0, - tzo: None, + year: 1997, month: 9, day: 2, + hour: 9, minute: 8, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "199709020908"); } @@ -1678,14 +853,9 @@ fn test_parse_simple11() { #[test] fn test_parse_simple12() { let pdt = PyDateTime { - year: 1997, - month: 9, - day: 2, - hour: 9, - minute: 8, - second: 7, - micros: 0, - tzo: None, + year: 1997, month: 9, day: 2, + hour: 9, minute: 8, second: 7, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "19970902090807"); } @@ -1693,14 +863,9 @@ fn test_parse_simple12() { #[test] fn test_parse_simple13() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003-09-25"); } @@ -1708,14 +873,9 @@ fn test_parse_simple13() { #[test] fn test_parse_simple14() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "09-25-2003"); } @@ -1723,14 +883,9 @@ fn test_parse_simple14() { #[test] fn test_parse_simple15() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "25-09-2003"); } @@ -1738,14 +893,9 @@ fn test_parse_simple15() { #[test] fn test_parse_simple16() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10-09-2003"); } @@ -1753,14 +903,9 @@ fn test_parse_simple16() { #[test] fn test_parse_simple17() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10-09-03"); } @@ -1768,14 +913,9 @@ fn test_parse_simple17() { #[test] fn test_parse_simple18() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003.09.25"); } @@ -1783,14 +923,9 @@ fn test_parse_simple18() { #[test] fn test_parse_simple19() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "09.25.2003"); } @@ -1798,14 +933,9 @@ fn test_parse_simple19() { #[test] fn test_parse_simple20() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "25.09.2003"); } @@ -1813,14 +943,9 @@ fn test_parse_simple20() { #[test] fn test_parse_simple21() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10.09.2003"); } @@ -1828,14 +953,9 @@ fn test_parse_simple21() { #[test] fn test_parse_simple22() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10.09.03"); } @@ -1843,14 +963,9 @@ fn test_parse_simple22() { #[test] fn test_parse_simple23() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003/09/25"); } @@ -1858,14 +973,9 @@ fn test_parse_simple23() { #[test] fn test_parse_simple24() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "09/25/2003"); } @@ -1873,14 +983,9 @@ fn test_parse_simple24() { #[test] fn test_parse_simple25() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "25/09/2003"); } @@ -1888,14 +993,9 @@ fn test_parse_simple25() { #[test] fn test_parse_simple26() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10/09/2003"); } @@ -1903,14 +1003,9 @@ fn test_parse_simple26() { #[test] fn test_parse_simple27() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10/09/03"); } @@ -1918,14 +1013,9 @@ fn test_parse_simple27() { #[test] fn test_parse_simple28() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2003 09 25"); } @@ -1933,14 +1023,9 @@ fn test_parse_simple28() { #[test] fn test_parse_simple29() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "09 25 2003"); } @@ -1948,14 +1033,9 @@ fn test_parse_simple29() { #[test] fn test_parse_simple30() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "25 09 2003"); } @@ -1963,14 +1043,9 @@ fn test_parse_simple30() { #[test] fn test_parse_simple31() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10 09 2003"); } @@ -1978,14 +1053,9 @@ fn test_parse_simple31() { #[test] fn test_parse_simple32() { let pdt = PyDateTime { - year: 2003, - month: 10, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 10, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "10 09 03"); } @@ -1993,14 +1063,9 @@ fn test_parse_simple32() { #[test] fn test_parse_simple33() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "25 09 03"); } @@ -2008,14 +1073,9 @@ fn test_parse_simple33() { #[test] fn test_parse_simple34() { let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "03 25 Sep"); } @@ -2023,14 +1083,9 @@ fn test_parse_simple34() { #[test] fn test_parse_simple35() { let pdt = PyDateTime { - year: 2025, - month: 9, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2025, month: 9, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "25 03 Sep"); } @@ -2038,14 +1093,9 @@ fn test_parse_simple35() { #[test] fn test_parse_simple36() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, " July 4 , 1976 12:01:02 am "); } @@ -2053,14 +1103,9 @@ fn test_parse_simple36() { #[test] fn test_parse_simple37() { let pdt = PyDateTime { - year: 1996, - month: 7, - day: 10, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1996, month: 7, day: 10, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "Wed, July 10, '96"); } @@ -2068,14 +1113,9 @@ fn test_parse_simple37() { #[test] fn test_parse_simple38() { let pdt = PyDateTime { - year: 1996, - month: 7, - day: 10, - hour: 12, - minute: 8, - second: 0, - micros: 0, - tzo: None, + year: 1996, month: 7, day: 10, + hour: 12, minute: 8, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "1996.July.10 AD 12:08 PM"); } @@ -2083,14 +1123,9 @@ fn test_parse_simple38() { #[test] fn test_parse_simple39() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "July 4, 1976"); } @@ -2098,14 +1133,9 @@ fn test_parse_simple39() { #[test] fn test_parse_simple40() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "7 4 1976"); } @@ -2113,14 +1143,9 @@ fn test_parse_simple40() { #[test] fn test_parse_simple41() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "4 jul 1976"); } @@ -2128,14 +1153,9 @@ fn test_parse_simple41() { #[test] fn test_parse_simple42() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "7-4-76"); } @@ -2143,14 +1163,9 @@ fn test_parse_simple42() { #[test] fn test_parse_simple43() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "19760704"); } @@ -2158,14 +1173,9 @@ fn test_parse_simple43() { #[test] fn test_parse_simple44() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "0:01:02 on July 4, 1976"); } @@ -2173,14 +1183,9 @@ fn test_parse_simple44() { #[test] fn test_parse_simple45() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "0:01:02 on July 4, 1976"); } @@ -2188,14 +1193,9 @@ fn test_parse_simple45() { #[test] fn test_parse_simple46() { let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "July 4, 1976 12:01:02 am"); } @@ -2203,14 +1203,9 @@ fn test_parse_simple46() { #[test] fn test_parse_simple47() { let pdt = PyDateTime { - year: 1995, - month: 1, - day: 2, - hour: 4, - minute: 24, - second: 27, - micros: 0, - tzo: None, + year: 1995, month: 1, day: 2, + hour: 4, minute: 24, second: 27, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "Mon Jan 2 04:24:27 1995"); } @@ -2218,14 +1213,9 @@ fn test_parse_simple47() { #[test] fn test_parse_simple48() { let pdt = PyDateTime { - year: 1995, - month: 4, - day: 4, - hour: 0, - minute: 22, - second: 0, - micros: 0, - tzo: None, + year: 1995, month: 4, day: 4, + hour: 0, minute: 22, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "04.04.95 00:22"); } @@ -2233,14 +1223,9 @@ fn test_parse_simple48() { #[test] fn test_parse_simple49() { let pdt = PyDateTime { - year: 1999, - month: 1, - day: 1, - hour: 11, - minute: 23, - second: 34, - micros: 578000, - tzo: None, + year: 1999, month: 1, day: 1, + hour: 11, minute: 23, second: 34, + micros: 578000, tzo: None, }; parse_and_assert_simple(pdt, "Jan 1 1999 11:23:34.578"); } @@ -2248,14 +1233,9 @@ fn test_parse_simple49() { #[test] fn test_parse_simple50() { let pdt = PyDateTime { - year: 1995, - month: 4, - day: 4, - hour: 12, - minute: 22, - second: 12, - micros: 0, - tzo: None, + year: 1995, month: 4, day: 4, + hour: 12, minute: 22, second: 12, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "950404 122212"); } @@ -2263,14 +1243,9 @@ fn test_parse_simple50() { #[test] fn test_parse_simple51() { let pdt = PyDateTime { - year: 2001, - month: 5, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2001, month: 5, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "3rd of May 2001"); } @@ -2278,14 +1253,9 @@ fn test_parse_simple51() { #[test] fn test_parse_simple52() { let pdt = PyDateTime { - year: 2001, - month: 3, - day: 5, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2001, month: 3, day: 5, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "5th of March 2001"); } @@ -2293,14 +1263,9 @@ fn test_parse_simple52() { #[test] fn test_parse_simple53() { let pdt = PyDateTime { - year: 2003, - month: 5, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 5, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "1st of May 2003"); } @@ -2308,14 +1273,9 @@ fn test_parse_simple53() { #[test] fn test_parse_simple54() { let pdt = PyDateTime { - year: 99, - month: 1, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 99, month: 1, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "0099-01-01T00:00:00"); } @@ -2323,14 +1283,9 @@ fn test_parse_simple54() { #[test] fn test_parse_simple55() { let pdt = PyDateTime { - year: 31, - month: 1, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 31, month: 1, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "0031-01-01T00:00:00"); } @@ -2338,14 +1293,9 @@ fn test_parse_simple55() { #[test] fn test_parse_simple56() { let pdt = PyDateTime { - year: 2008, - month: 2, - day: 27, - hour: 21, - minute: 26, - second: 1, - micros: 123456, - tzo: None, + year: 2008, month: 2, day: 27, + hour: 21, minute: 26, second: 1, + micros: 123456, tzo: None, }; parse_and_assert_simple(pdt, "20080227T21:26:01.123456789"); } @@ -2353,14 +1303,9 @@ fn test_parse_simple56() { #[test] fn test_parse_simple57() { let pdt = PyDateTime { - year: 2017, - month: 11, - day: 13, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2017, month: 11, day: 13, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "13NOV2017"); } @@ -2368,14 +1313,9 @@ fn test_parse_simple57() { #[test] fn test_parse_simple58() { let pdt = PyDateTime { - year: 3, - month: 3, - day: 4, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 3, month: 3, day: 4, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "0003-03-04"); } @@ -2383,14 +1323,9 @@ fn test_parse_simple58() { #[test] fn test_parse_simple59() { let pdt = PyDateTime { - year: 31, - month: 12, - day: 30, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 31, month: 12, day: 30, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "December.0031.30"); } @@ -2398,14 +1333,9 @@ fn test_parse_simple59() { #[test] fn test_parse_simple60() { let pdt = PyDateTime { - year: 2007, - month: 9, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2007, month: 9, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "090107"); } @@ -2413,14 +1343,9 @@ fn test_parse_simple60() { #[test] fn test_parse_simple61() { let pdt = PyDateTime { - year: 2015, - month: 5, - day: 15, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2015, month: 5, day: 15, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; parse_and_assert_simple(pdt, "2015-15-May"); } @@ -2429,1204 +1354,530 @@ fn test_parse_simple61() { fn test_parse_tzinfo0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "Thu Sep 25 10:36:28 BRST 2003", - None, - None, - false, - false, - None, - false, - &rs_tzinfo_map!(), - ); + parse_and_assert(pdt, info, "Thu Sep 25 10:36:28 BRST 2003", None, None, false, false, + None, false, &rs_tzinfo_map!()); } #[test] fn test_parse_tzinfo1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "2003 10:36:28 BRST 25 Sep Thu", - None, - None, - false, - false, - None, - false, - &rs_tzinfo_map!(), - ); + parse_and_assert(pdt, info, "2003 10:36:28 BRST 25 Sep Thu", None, None, false, false, + None, false, &rs_tzinfo_map!()); } #[test] fn test_parse_offset0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "Thu, 25 Sep 2003 10:49:41 -0300", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Thu, 25 Sep 2003 10:49:41 -0300", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 500000, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 500000, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "2003-09-25T10:49:41.5-03:00", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2003-09-25T10:49:41.5-03:00", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset2() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "2003-09-25T10:49:41-03:00", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2003-09-25T10:49:41-03:00", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset3() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 500000, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 500000, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "20030925T104941.5-0300", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "20030925T104941.5-0300", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset4() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "20030925T104941-0300", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "20030925T104941-0300", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset5() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2018, - month: 8, - day: 10, - hour: 10, - minute: 0, - second: 0, - micros: 0, - tzo: Some(-10800), + year: 2018, month: 8, day: 10, + hour: 10, minute: 0, second: 0, + micros: 0, tzo: Some(-10800), }; - parse_and_assert( - pdt, - info, - "2018-08-10 10:00:00 UTC+3", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2018-08-10 10:00:00 UTC+3", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset6() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2018, - month: 8, - day: 10, - hour: 15, - minute: 36, - second: 47, - micros: 0, - tzo: Some(14400), + year: 2018, month: 8, day: 10, + hour: 15, minute: 36, second: 47, + micros: 0, tzo: Some(14400), }; - parse_and_assert( - pdt, - info, - "2018-08-10 03:36:47 PM GMT-4", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2018-08-10 03:36:47 PM GMT-4", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_offset7() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2018, - month: 8, - day: 10, - hour: 4, - minute: 15, - second: 0, - micros: 0, - tzo: Some(7200), + year: 2018, month: 8, day: 10, + hour: 4, minute: 15, second: 0, + micros: 0, tzo: Some(7200), }; - parse_and_assert( - pdt, - info, - "2018-08-10 04:15:00 AM Z-02:00", - None, - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2018-08-10 04:15:00 AM Z-02:00", None, None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dayfirst0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 10, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 10, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10-09-2003", - Some(true), - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10-09-2003", Some(true), None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dayfirst1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 10, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 10, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10.09.2003", - Some(true), - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10.09.2003", Some(true), None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dayfirst2() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 10, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 10, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10/09/2003", - Some(true), - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10/09/2003", Some(true), None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dayfirst3() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 10, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 10, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10 09 2003", - Some(true), - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10 09 2003", Some(true), None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dayfirst4() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2007, - month: 1, - day: 9, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2007, month: 1, day: 9, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "090107", - Some(true), - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "090107", Some(true), None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dayfirst5() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2015, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2015, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "2015 09 25", - Some(true), - None, - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2015 09 25", Some(true), None, false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_yearfirst0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2010, - month: 9, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2010, month: 9, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10-09-03", - None, - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10-09-03", None, Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_yearfirst1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2010, - month: 9, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2010, month: 9, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10.09.03", - None, - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10.09.03", None, Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_yearfirst2() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2010, - month: 9, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2010, month: 9, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10/09/03", - None, - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10/09/03", None, Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_yearfirst3() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2010, - month: 9, - day: 3, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2010, month: 9, day: 3, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "10 09 03", - None, - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "10 09 03", None, Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_yearfirst4() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2009, - month: 1, - day: 7, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2009, month: 1, day: 7, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "090107", - None, - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "090107", None, Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_yearfirst5() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2015, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2015, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "2015 09 25", - None, - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2015 09 25", None, Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dfyf0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2009, - month: 7, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2009, month: 7, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "090107", - Some(true), - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "090107", Some(true), Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_parse_dfyf1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2015, - month: 9, - day: 25, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2015, month: 9, day: 25, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None, }; - parse_and_assert( - pdt, - info, - "2015 09 25", - Some(true), - Some(true), - false, - false, - None, - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "2015 09 25", Some(true), Some(true), false, false, + None, false, &HashMap::new()); } #[test] fn test_unspecified_fallback0() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2010, 1, 31).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2010, 1, 31).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2009, - month: 4, - day: 30, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2009, month: 4, day: 30, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "April 2009", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "April 2009", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_unspecified_fallback1() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2010, 1, 31).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2010, 1, 31).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2007, - month: 2, - day: 28, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2007, month: 2, day: 28, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Feb 2007", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Feb 2007", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_unspecified_fallback2() { let info = ParserInfo::default(); - let default_rsdate = &NaiveDate::from_ymd(2010, 1, 31).and_hms(0, 0, 0); + let default_rsdate = &NaiveDate::from_ymd_opt(2010, 1, 31).unwrap().and_hms_opt(0, 0, 0).unwrap(); let pdt = PyDateTime { - year: 2008, - month: 2, - day: 29, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2008, month: 2, day: 29, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Feb 2008", - None, - None, - false, - false, - Some(default_rsdate), - false, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Feb 2008", None, None, false, false, + Some(default_rsdate), false, &HashMap::new()); } #[test] fn test_parse_ignoretz0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 36, - second: 28, - micros: 0, - tzo: None, + year: 2003, month: 9, day: 25, + hour: 10, minute: 36, second: 28, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Thu Sep 25 10:36:28 BRST 2003", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Thu Sep 25 10:36:28 BRST 2003", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1996, - month: 7, - day: 10, - hour: 15, - minute: 8, - second: 56, - micros: 0, - tzo: None, + year: 1996, month: 7, day: 10, + hour: 15, minute: 8, second: 56, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "1996.07.10 AD at 15:08:56 PDT", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "1996.07.10 AD at 15:08:56 PDT", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz2() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1952, - month: 4, - day: 12, - hour: 15, - minute: 30, - second: 42, - micros: 0, - tzo: None, + year: 1952, month: 4, day: 12, + hour: 15, minute: 30, second: 42, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Tuesday, April 12, 1952 AD 3:30:42pm PST", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Tuesday, April 12, 1952 AD 3:30:42pm PST", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz3() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1994, - month: 11, - day: 5, - hour: 8, - minute: 15, - second: 30, - micros: 0, - tzo: None, + year: 1994, month: 11, day: 5, + hour: 8, minute: 15, second: 30, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "November 5, 1994, 8:15:30 am EST", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "November 5, 1994, 8:15:30 am EST", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz4() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1994, - month: 11, - day: 5, - hour: 8, - minute: 15, - second: 30, - micros: 0, - tzo: None, + year: 1994, month: 11, day: 5, + hour: 8, minute: 15, second: 30, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "1994-11-05T08:15:30-05:00", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "1994-11-05T08:15:30-05:00", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz5() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1994, - month: 11, - day: 5, - hour: 8, - minute: 15, - second: 30, - micros: 0, - tzo: None, + year: 1994, month: 11, day: 5, + hour: 8, minute: 15, second: 30, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "1994-11-05T08:15:30Z", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "1994-11-05T08:15:30Z", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz6() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1976, - month: 7, - day: 4, - hour: 0, - minute: 1, - second: 2, - micros: 0, - tzo: None, + year: 1976, month: 7, day: 4, + hour: 0, minute: 1, second: 2, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "1976-07-04T00:01:02Z", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "1976-07-04T00:01:02Z", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz7() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1986, - month: 7, - day: 5, - hour: 8, - minute: 15, - second: 30, - micros: 0, - tzo: None, + year: 1986, month: 7, day: 5, + hour: 8, minute: 15, second: 30, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "1986-07-05T08:15:30z", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "1986-07-05T08:15:30z", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_parse_ignoretz8() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1995, - month: 4, - day: 4, - hour: 0, - minute: 22, - second: 12, - micros: 0, - tzo: None, + year: 1995, month: 4, day: 4, + hour: 0, minute: 22, second: 12, + micros: 0, tzo: None }; - parse_and_assert( - pdt, - info, - "Tue Apr 4 00:22:12 PDT 1995", - None, - None, - false, - false, - None, - true, - &HashMap::new(), - ); + parse_and_assert(pdt, info, "Tue Apr 4 00:22:12 PDT 1995", None, None, false, false, + None, true, &HashMap::new()); } #[test] fn test_fuzzy_tzinfo0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: Some(-10800) }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "Today is 25 of September of 2003, exactly at 10:49:41 with timezone -03:00.", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "Today is 25 of September of 2003, exactly at 10:49:41 with timezone -03:00.", None, None, true, false, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_tokens_tzinfo0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 9, - day: 25, - hour: 10, - minute: 49, - second: 41, - micros: 0, - tzo: Some(-10800), + year: 2003, month: 9, day: 25, + hour: 10, minute: 49, second: 41, + micros: 0, tzo: Some(-10800) }; - let tokens = vec![ - "Today is ".to_owned(), - "of ".to_owned(), - ", exactly at ".to_owned(), - " with timezone ".to_owned(), - ".".to_owned(), - ]; - parse_fuzzy_and_assert( - pdt, - Some(tokens), - info, - "Today is 25 of September of 2003, exactly at 10:49:41 with timezone -03:00.", - None, - None, - true, - true, - None, - false, - &HashMap::new(), - ); + let tokens = vec!["Today is ".to_owned(), "of ".to_owned(), ", exactly at ".to_owned(), " with timezone ".to_owned(), ".".to_owned()]; + parse_fuzzy_and_assert(pdt, Some(tokens), info, "Today is 25 of September of 2003, exactly at 10:49:41 with timezone -03:00.", None, None, true, true, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_simple0() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1974, - month: 3, - day: 1, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 1974, month: 3, day: 1, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "I have a meeting on March 1, 1974", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "I have a meeting on March 1, 1974", None, None, true, false, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_simple1() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2020, - month: 6, - day: 8, - hour: 0, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2020, month: 6, day: 8, + hour: 0, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "On June 8th, 2020, I am going to be the first man on Mars", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "On June 8th, 2020, I am going to be the first man on Mars", None, None, true, false, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_simple2() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 12, - day: 3, - hour: 3, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 12, day: 3, + hour: 3, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "Meet me at the AM/PM on Sunset at 3:00 AM on December 3rd, 2003", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "Meet me at the AM/PM on Sunset at 3:00 AM on December 3rd, 2003", None, None, true, false, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_simple3() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2003, - month: 12, - day: 3, - hour: 3, - minute: 0, - second: 0, - micros: 0, - tzo: None, + year: 2003, month: 12, day: 3, + hour: 3, minute: 0, second: 0, + micros: 0, tzo: None }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "Meet me at 3:00 AM on December 3rd, 2003 at the AM/PM on Sunset", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "Meet me at 3:00 AM on December 3rd, 2003 at the AM/PM on Sunset", None, None, true, false, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_simple4() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 1945, - month: 1, - day: 29, - hour: 14, - minute: 45, - second: 0, - micros: 0, - tzo: None, + year: 1945, month: 1, day: 29, + hour: 14, minute: 45, second: 0, + micros: 0, tzo: None }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "Jan 29, 1945 14:45 AM I going to see you there?", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "Jan 29, 1945 14:45 AM I going to see you there?", None, None, true, false, + None, false, &HashMap::new()); } #[test] fn test_fuzzy_simple5() { let info = ParserInfo::default(); let pdt = PyDateTime { - year: 2017, - month: 7, - day: 17, - hour: 6, - minute: 15, - second: 0, - micros: 0, - tzo: None, + year: 2017, month: 7, day: 17, + hour: 6, minute: 15, second: 0, + micros: 0, tzo: None }; - parse_fuzzy_and_assert( - pdt, - None, - info, - "2017-07-17 06:15:", - None, - None, - true, - false, - None, - false, - &HashMap::new(), - ); + parse_fuzzy_and_assert(pdt, None, info, "2017-07-17 06:15:", None, None, true, false, + None, false, &HashMap::new()); }