| 1 | use craterust-analyzer cargo rrule 0.14.0 crate/::testsrust-analyzer cargo rrule 0.14.0 tests/::commonrust-analyzer cargo rrule 0.14.0 tests/common/; |
| 2 | use craterust-analyzer cargo rrule 0.14.0 crate/::RRuleSetrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleSet#; |
| 3 | |
| 4 | /// Monthly on the 31st of the month |
| 5 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 6 | fn monthly_on_31thrust-analyzer cargo rrule 0.14.0 tests/datetime/monthly_on_31th().() { |
| 7 | let dates = "DTSTART;TZID=America/New_York:19970902T090000\n\ |
| 8 | RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=31" |
| 9 | .parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().::<RRuleSetrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleSet#>() |
| 10 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 11 | .allrust-analyzer cargo rrule 0.14.0 core/rruleset/impl#[RRuleSet]all().(u16::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]MAX.) |
| 12 | .datesrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleResult#dates.; |
| 13 | // TODO: Is this the correct behavior? |
| 14 | commonrust-analyzer cargo rrule 0.14.0 tests/common/::check_occurrencesrust-analyzer cargo rrule 0.14.0 tests/common/check_occurrences().( |
| 15 | &dates, |
| 16 | &[ |
| 17 | "1997-10-31T09:00:00-05:00", |
| 18 | "1997-12-31T09:00:00-05:00", |
| 19 | "1998-01-31T09:00:00-05:00", |
| 20 | "1998-03-31T09:00:00-05:00", |
| 21 | "1998-05-31T09:00:00-04:00", |
| 22 | "1998-07-31T09:00:00-04:00", |
| 23 | "1998-08-31T09:00:00-04:00", |
| 24 | "1998-10-31T09:00:00-05:00", |
| 25 | "1998-12-31T09:00:00-05:00", |
| 26 | "1999-01-31T09:00:00-05:00", |
| 27 | ], |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | /// Monthly on the 31th-to-last of the month |
| 32 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 33 | fn monthly_on_31th_to_lastrust-analyzer cargo rrule 0.14.0 tests/datetime/monthly_on_31th_to_last().() { |
| 34 | let dates = "DTSTART;TZID=America/New_York:19970902T090000\n\ |
| 35 | RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=-31" |
| 36 | .parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().::<RRuleSetrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleSet#>() |
| 37 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 38 | .allrust-analyzer cargo rrule 0.14.0 core/rruleset/impl#[RRuleSet]all().(u16::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]MAX.) |
| 39 | .datesrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleResult#dates.; |
| 40 | // TODO: Is this the correct behavior? |
| 41 | commonrust-analyzer cargo rrule 0.14.0 tests/common/::check_occurrencesrust-analyzer cargo rrule 0.14.0 tests/common/check_occurrences().( |
| 42 | &dates, |
| 43 | &[ |
| 44 | "1997-10-01T09:00:00-04:00", |
| 45 | "1997-12-01T09:00:00-05:00", |
| 46 | "1998-01-01T09:00:00-05:00", |
| 47 | "1998-03-01T09:00:00-05:00", |
| 48 | "1998-05-01T09:00:00-04:00", |
| 49 | "1998-07-01T09:00:00-04:00", |
| 50 | "1998-08-01T09:00:00-04:00", |
| 51 | "1998-10-01T09:00:00-04:00", |
| 52 | "1998-12-01T09:00:00-05:00", |
| 53 | "1999-01-01T09:00:00-05:00", |
| 54 | ], |
| 55 | ); |
| 56 | } |