aboutsummaryrefslogtreecommitdiff
path: root/tests/test-calendar-sync--expand-monthly.el
Commit message (Collapse)AuthorAgeFilesLines
* fix(test): anchor monthly tests on a day every month hasCraig Jennings2026-07-301-10/+17
| | | | | | | | | | | | | | | | | | - The tests anchored on tomorrow, whose day varies by run date. - A series on the 31st correctly skips months without one. - That gave seven occurrences against an assertion of ten. - The suite went red on the 30th and aborted the run. A relative offset is not a date-independent anchor, which is what the file header claimed it was. I added a helper that walks forward to the first day at or below the 28th, and pointed the three cadence tests at it. One assertion was also too weak to notice. It checked that each occurrence fell on or before the anchor day, which a skipped month satisfies without ever landing on the right day. It now checks equality. Verified across 400 simulated run dates: no anchor past the 28th and no count outside the expected band. The old anchor fails nine of those days.
* test: make the 31st-recurrence and immediate-insert tests env-stableCraig Jennings2026-07-201-1/+3
| | | | The calendar test's range ended at midnight Dec 31, excluding that day's occurrence, and the org-roam test asserted special-variable-p, which answers differently in the package-loaded hook env versus bare batch (a bare defvar is a file-local declaration). The recurrence test now ends the range past the year and the insert test asserts the binding behaviorally.
* fix(calendar): skip short months for plain monthly-on-the-31st rulesCraig Jennings2026-07-201-0/+18
| | | | The stepper kept day-of-month verbatim, so Jan 31 stepped to Feb 31 and encode-time normalized it into a phantom Mar 3 occurrence. Plain monthly rules now advance to the next month that has the day, per RFC 5545.
* fix(calendar-sync): honor BYDAY rules and drop cancelled eventsCraig Jennings2026-07-181-0/+99
| | | | | | | | The expander ignored BYDAY on monthly and yearly rules and stepped DTSTART's day-of-month instead, so a "2nd Wednesday" series rendered on the 12th of every month, the wrong weekday most months. It now resolves nth-weekday entries (2WE, -1TU), bare weekdays with BYSETPOS, and yearly BYMONTH+BYDAY, so each occurrence lands on the day the rule names. Nothing read the VEVENT STATUS property, so cancelled events rendered as normal meetings: a cancelled instance of a series reappeared at its original time, and standalone cancelled events stayed on the agenda. parse-event now drops STATUS:CANCELLED events, which also kills cancelled series masters. A cancelled RECURRENCE-ID override removes its occurrence instead of overriding it. The fixes are coupled: until BYDAY generates the right dates, a cancelled override can't match the occurrence it removes.
* feat(music): add random-aware next/previous; refactor music + calendar-syncCraig Jennings2026-04-031-0/+174
Music: random mode now respected by next/previous keys. Previous navigates a 50-track play history ring buffer. Fixed playlist replacement bug. 24 new tests. Calendar-sync: consolidated duplicate parse functions, extracted timezone localization helper, unified expand-daily/monthly/yearly into parameterized function, removed dead code. 33 new characterization tests. -90 lines.