| 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/::check_occurrencesrust-analyzer cargo rrule 0.14.0 tests/common/check_occurrences()., RRuleSetrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleSet#}; |
| 2 | |
| 3 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 4 | fn daylight_savings_1rust-analyzer cargo rrule 0.14.0 tests/daylight_saving/daylight_savings_1().() { |
| 5 | let rrule: RRuleSetrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleSet# = |
| 6 | "DTSTART;TZID=America/Vancouver:20210301T022210\nRRULE:FREQ=DAILY;COUNT=30" |
| 7 | .parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().() |
| 8 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 9 | |
| 10 | let dates = rrule.all_uncheckedrust-analyzer cargo rrule 0.14.0 core/rruleset/impl#[RRuleSet]all_unchecked().(); |
| 11 | check_occurrencesrust-analyzer cargo rrule 0.14.0 tests/common/check_occurrences().( |
| 12 | &dates, |
| 13 | &[ |
| 14 | "2021-03-01T02:22:10-08:00", |
| 15 | "2021-03-02T02:22:10-08:00", |
| 16 | "2021-03-03T02:22:10-08:00", |
| 17 | "2021-03-04T02:22:10-08:00", |
| 18 | "2021-03-05T02:22:10-08:00", |
| 19 | "2021-03-06T02:22:10-08:00", |
| 20 | "2021-03-07T02:22:10-08:00", |
| 21 | "2021-03-08T02:22:10-08:00", |
| 22 | "2021-03-09T02:22:10-08:00", |
| 23 | "2021-03-10T02:22:10-08:00", |
| 24 | "2021-03-11T02:22:10-08:00", |
| 25 | "2021-03-12T02:22:10-08:00", |
| 26 | "2021-03-13T02:22:10-08:00", |
| 27 | "2021-03-14T03:22:10-07:00", |
| 28 | "2021-03-15T02:22:10-07:00", |
| 29 | "2021-03-16T02:22:10-07:00", |
| 30 | "2021-03-17T02:22:10-07:00", |
| 31 | "2021-03-18T02:22:10-07:00", |
| 32 | "2021-03-19T02:22:10-07:00", |
| 33 | "2021-03-20T02:22:10-07:00", |
| 34 | "2021-03-21T02:22:10-07:00", |
| 35 | "2021-03-22T02:22:10-07:00", |
| 36 | "2021-03-23T02:22:10-07:00", |
| 37 | "2021-03-24T02:22:10-07:00", |
| 38 | "2021-03-25T02:22:10-07:00", |
| 39 | "2021-03-26T02:22:10-07:00", |
| 40 | "2021-03-27T02:22:10-07:00", |
| 41 | "2021-03-28T02:22:10-07:00", |
| 42 | "2021-03-29T02:22:10-07:00", |
| 43 | "2021-03-30T02:22:10-07:00", |
| 44 | ], |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 49 | fn daylight_savings_2rust-analyzer cargo rrule 0.14.0 tests/daylight_saving/daylight_savings_2().() { |
| 50 | let dates = "DTSTART;TZID=Europe/Paris:20210214T093000\n\ |
| 51 | RRULE:FREQ=WEEKLY;UNTIL=20210508T083000Z;INTERVAL=2;BYDAY=MO;WKST=MO" |
| 52 | .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#>() |
| 53 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 54 | .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.) |
| 55 | .datesrust-analyzer cargo rrule 0.14.0 core/rruleset/RRuleResult#dates.; |
| 56 | check_occurrencesrust-analyzer cargo rrule 0.14.0 tests/common/check_occurrences().( |
| 57 | &dates, |
| 58 | &[ |
| 59 | "2021-02-22T09:30:00+01:00", |
| 60 | "2021-03-08T09:30:00+01:00", |
| 61 | "2021-03-22T09:30:00+01:00", |
| 62 | "2021-04-05T09:30:00+02:00", // Switching to daylight saving time. |
| 63 | "2021-04-19T09:30:00+02:00", |
| 64 | "2021-05-03T09:30:00+02:00", |
| 65 | ], |
| 66 | ); |
| 67 | } |