diff options
author | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-15 19:44:56 +0200 |
---|---|---|
committer | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-15 19:44:56 +0200 |
commit | 7287da2370df7c93789d3456b4a70c32e7745b4d (patch) | |
tree | 3233f2088e2100cc0947490ce6c8dfbbe45c3390 /src/iter.rs | |
parent | 20d78ed504961540820fa78f82aec10cd935d60d (diff) | |
download | rust_rrule-7287da2370df7c93789d3456b4a70c32e7745b4d.zip |
moved tests
Diffstat (limited to 'src/iter.rs')
-rw-r--r-- | src/iter.rs | 70 |
1 files changed, 5 insertions, 65 deletions
diff --git a/src/iter.rs b/src/iter.rs index 4f2c206..026ae31 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -13,11 +13,11 @@ pub enum QueryMethodTypes { } pub struct IterArgs { - inc: bool, - before: DateTime<Utc>, - after: DateTime<Utc>, - dt: DateTime<Utc>, - _value: Option<Vec<DateTime<Utc>>>, + pub inc: bool, + pub before: DateTime<Utc>, + pub after: DateTime<Utc>, + pub dt: DateTime<Utc>, + pub _value: Option<Vec<DateTime<Utc>>>, } pub struct IterResult { @@ -382,63 +382,3 @@ pub fn make_timeset( counter_date.timestamp_subsec_millis() as usize, ); } - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn int_works() { - let iter_args = IterArgs { - inc: true, - before: Utc::now(), - after: Utc::now(), - dt: Utc::now(), - _value: Some(vec![]), - }; - let mut iter_res = IterResult::new(QueryMethodTypes::ALL, iter_args); - let mut options = ParsedOptions { - freq: Frequenzy::DAILY, - dtstart: Utc.ymd(2012, 1, 1).and_hms(10, 30, 0), - until: Some(Utc.ymd(2012, 12, 31).and_hms(10, 30, 0)), - tzid: None, - interval: 1, - wkst: 0, - count: None, - bysecond: vec![0], - byminute: vec![30], - byhour: vec![10], - bymonth: vec![], - bymonthday: vec![], - bysetpos: vec![], - byweekno: vec![], - byyearday: vec![], - byweekday: vec![0, 1, 2, 3, 4, 5, 6], - bynweekday: vec![], - bynmonthday: vec![], - }; - let mut options_2 = ParsedOptions { - freq: Frequenzy::WEEKLY, - dtstart: Utc.ymd(2012, 1, 1).and_hms(10, 30, 0), - until: None, - //until: Some(Utc.ymd(2012, 12, 31).and_hms(10, 30, 0)), - tzid: None, - interval: 5, - wkst: 0, - count: Some(5), - bysecond: vec![0], - byminute: vec![30], - byhour: vec![10], - bymonth: vec![6], - bymonthday: vec![], - bysetpos: vec![], - byweekno: vec![], - byyearday: vec![], - byweekday: vec![0, 4], - bynweekday: vec![], - bynmonthday: vec![], - }; - let res = iter(&mut iter_res, &mut options); - println!("Res: {:?}", res); - } -} |