Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar: ICS: Unit tests #456

Open
benbucksch opened this issue Feb 25, 2025 · 3 comments
Open

Calendar: ICS: Unit tests #456

benbucksch opened this issue Feb 25, 2025 · 3 comments
Assignees
Labels

Comments

@benbucksch
Copy link
Collaborator

benbucksch commented Feb 25, 2025

Create unit tests to check whether we can read the iCal/ICS files correctly and correctly interpret the data in it.

That means reading it in an Event object, writing it out as JSCalendar JSON object, and comparing the result with the expected result.
This should be based on test cases supplied by others, en masse.

Potential sources:

Pay attention for licenses, please.

Other parsers or resources:

@NeilRashbrook
Copy link
Collaborator

Of 45 request, reply and cancel messages I found from the files in https://github.com/libical/libical/tree/master/test-data

  • I haven't looked to see how the messages are used, so it's possible that some of them have deliberate errors.
    • 1 has a malformed METHOD
    • 2 have a malformed DTSTART
    • 3 have a malformed DTEND
  • None of the reply and cancel messages bother filling in the whole event; they only provide the UID and ATTENDEEs. I haven't checked to see whether this is permitted.
  • I found some code errors; I don't know whether it's worth creating individual PRs for each of these.
    • We aren't parsing the recurrence rule case-insensitively (as it happens all of the test cases were already in upper case)
    • Stringifying the recurrence rule should use the allDay format as appropriate
    • The wrong variable is being used to check for the organiser being a participant
    • It is possible for the organiser to match against multiple participants

@NeilRashbrook
Copy link
Collaborator

Of the rest of the sample files, most weren't in a format that looked like an invitation, so I'm not sure how useful they are as a test, but I was able to adapt a few more, which led me to discover that all day events weren't being properly recognised,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants