summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Meringdal <fmeringdal@hotmail.com>2020-10-17 13:53:11 +0200
committerFredrik Meringdal <fmeringdal@hotmail.com>2020-10-17 13:53:11 +0200
commit5e6bd01bb9c847838ea9f3d5f648a3bc629efb3f (patch)
tree4b181dfc8bf0c42bfba91d3a14328e4709f1770c
parent22c088275d0e1e58d65751e50552ea41a2e10b98 (diff)
downloadrust_rrule-5e6bd01bb9c847838ea9f3d5f648a3bc629efb3f.zip
most hourly tests migrated and passes
-rw-r--r--tests/rrule.rs195
1 files changed, 195 insertions, 0 deletions
diff --git a/tests/rrule.rs b/tests/rrule.rs
index 745577a..29c1317 100644
--- a/tests/rrule.rs
+++ b/tests/rrule.rs
@@ -4172,6 +4172,7 @@ mod test {
],
);
}
+
#[test]
fn hourly_by_minute() {
let mut options = ParsedOptions {
@@ -4203,4 +4204,198 @@ mod test {
],
);
}
+
+ #[test]
+ fn hourly_by_second() {
+ let mut options = ParsedOptions {
+ freq: Frequenzy::HOURLY,
+ count: Some(3),
+ bymonth: vec![],
+ dtstart: ymd_hms(1997, 9, 2, 9, 0, 0),
+ byweekday: vec![],
+ byhour: vec![],
+ bysetpos: vec![],
+ byweekno: vec![],
+ byminute: vec![0],
+ bysecond: vec![6, 18],
+ byyearday: vec![],
+ bymonthday: vec![],
+ bynweekday: vec![],
+ bynmonthday: vec![],
+ until: None,
+ wkst: 0,
+ tzid: None,
+ interval: 1,
+ };
+ test_recurring(
+ &mut options,
+ &vec![
+ ymd_hms(1997, 9, 2, 9, 0, 6),
+ ymd_hms(1997, 9, 2, 9, 0, 18),
+ ymd_hms(1997, 9, 2, 10, 0, 6),
+ ],
+ );
+ }
+
+ #[test]
+ fn hourly_by_hour_and_minute() {
+ let mut options = ParsedOptions {
+ freq: Frequenzy::HOURLY,
+ count: Some(3),
+ bymonth: vec![],
+ dtstart: ymd_hms(1997, 9, 2, 9, 0, 0),
+ byweekday: vec![],
+ byhour: vec![6, 18],
+ bysetpos: vec![],
+ byweekno: vec![],
+ byminute: vec![6, 18],
+ bysecond: vec![0],
+ byyearday: vec![],
+ bymonthday: vec![],
+ bynweekday: vec![],
+ bynmonthday: vec![],
+ until: None,
+ wkst: 0,
+ tzid: None,
+ interval: 1,
+ };
+ test_recurring(
+ &mut options,
+ &vec![
+ ymd_hms(1997, 9, 2, 18, 6, 0),
+ ymd_hms(1997, 9, 2, 18, 18, 0),
+ ymd_hms(1997, 9, 3, 6, 6, 0),
+ ],
+ );
+ }
+
+ #[test]
+ fn hourly_by_hour_and_second() {
+ let mut options = ParsedOptions {
+ freq: Frequenzy::HOURLY,
+ count: Some(3),
+ bymonth: vec![],
+ dtstart: ymd_hms(1997, 9, 2, 9, 0, 0),
+ byweekday: vec![],
+ byhour: vec![6, 18],
+ bysetpos: vec![],
+ byweekno: vec![],
+ byminute: vec![0],
+ bysecond: vec![6, 18],
+ byyearday: vec![],
+ bymonthday: vec![],
+ bynweekday: vec![],
+ bynmonthday: vec![],
+ until: None,
+ wkst: 0,
+ tzid: None,
+ interval: 1,
+ };
+ test_recurring(
+ &mut options,
+ &vec![
+ ymd_hms(1997, 9, 2, 18, 0, 6),
+ ymd_hms(1997, 9, 2, 18, 0, 18),
+ ymd_hms(1997, 9, 3, 6, 0, 6),
+ ],
+ );
+ }
+
+ #[test]
+ fn hourly_by_minute_and_second() {
+ let mut options = ParsedOptions {
+ freq: Frequenzy::HOURLY,
+ count: Some(3),
+ bymonth: vec![],
+ dtstart: ymd_hms(1997, 9, 2, 9, 0, 0),
+ byweekday: vec![],
+ byhour: vec![],
+ bysetpos: vec![],
+ byweekno: vec![],
+ byminute: vec![6, 18],
+ bysecond: vec![6, 18],
+ byyearday: vec![],
+ bymonthday: vec![],
+ bynweekday: vec![],
+ bynmonthday: vec![],
+ until: None,
+ wkst: 0,
+ tzid: None,
+ interval: 1,
+ };
+ test_recurring(
+ &mut options,
+ &vec![
+ ymd_hms(1997, 9, 2, 9, 6, 6),
+ ymd_hms(1997, 9, 2, 9, 6, 18),
+ ymd_hms(1997, 9, 2, 9, 18, 6),
+ ],
+ );
+ }
+
+ #[test]
+ fn hourly_by_hour_and_minute_and_second() {
+ let mut options = ParsedOptions {
+ freq: Frequenzy::HOURLY,
+ count: Some(5),
+ bymonth: vec![],
+ dtstart: ymd_hms(1997, 9, 2, 9, 0, 0),
+ byweekday: vec![],
+ byhour: vec![6, 18],
+ bysetpos: vec![],
+ byweekno: vec![],
+ byminute: vec![6, 18],
+ bysecond: vec![6, 18],
+ byyearday: vec![],
+ bymonthday: vec![],
+ bynweekday: vec![],
+ bynmonthday: vec![],
+ until: None,
+ wkst: 0,
+ tzid: None,
+ interval: 1,
+ };
+ test_recurring(
+ &mut options,
+ &vec![
+ ymd_hms(1997, 9, 2, 18, 6, 6),
+ ymd_hms(1997, 9, 2, 18, 6, 18),
+ ymd_hms(1997, 9, 2, 18, 18, 6),
+ ymd_hms(1997, 9, 2, 18, 18, 18),
+ ymd_hms(1997, 9, 3, 6, 6, 6),
+ ],
+ );
+ }
+
+ #[test]
+ fn hourly_by_setpos() {
+ let mut options = ParsedOptions {
+ freq: Frequenzy::HOURLY,
+ count: Some(3),
+ bymonth: vec![],
+ dtstart: ymd_hms(1997, 9, 2, 9, 0, 0),
+ byweekday: vec![],
+ byhour: vec![],
+ bysetpos: vec![3, -3],
+ byweekno: vec![],
+ byminute: vec![15, 45],
+ bysecond: vec![15, 45],
+ byyearday: vec![],
+ bymonthday: vec![],
+ bynweekday: vec![],
+ bynmonthday: vec![],
+ until: None,
+ wkst: 0,
+ tzid: None,
+ interval: 1,
+ };
+ test_recurring(
+ &mut options,
+ &vec![
+ ymd_hms(1997, 9, 2, 9, 15, 45),
+ ymd_hms(1997, 9, 2, 9, 45, 15),
+ ymd_hms(1997, 9, 2, 10, 15, 45),
+ ],
+ );
+ }
}