diff options
| -rw-r--r-- | test/lisp/gnus/gnus-icalendar-tests.el | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/test/lisp/gnus/gnus-icalendar-tests.el b/test/lisp/gnus/gnus-icalendar-tests.el index 48a9996e7a8..be23c90af37 100644 --- a/test/lisp/gnus/gnus-icalendar-tests.el +++ b/test/lisp/gnus/gnus-icalendar-tests.el | |||
| @@ -38,18 +38,10 @@ | |||
| 38 | (setq event (gnus-icalendar-event-from-buffer (buffer-name) participant))) | 38 | (setq event (gnus-icalendar-event-from-buffer (buffer-name) participant))) |
| 39 | event)) | 39 | event)) |
| 40 | 40 | ||
| 41 | (defun icalendar-tests--get-ical-event (ical-string) | ||
| 42 | "Return iCalendar event for ICAL-STRING." | ||
| 43 | (save-excursion | ||
| 44 | (with-temp-buffer | ||
| 45 | (insert ical-string) | ||
| 46 | (goto-char (point-min)) | ||
| 47 | (car (icalendar--read-element nil nil))))) | ||
| 48 | |||
| 49 | (ert-deftest gnus-icalendar-parse () | 41 | (ert-deftest gnus-icalendar-parse () |
| 50 | "test" | 42 | "test" |
| 51 | (let ((tz (getenv "TZ")) | 43 | (let ((tz (getenv "TZ")) |
| 52 | (event (gnus-icalendar-tests--get-ical-event " | 44 | (event (gnus-icalendar-tests--get-ical-event "\ |
| 53 | BEGIN:VCALENDAR | 45 | BEGIN:VCALENDAR |
| 54 | PRODID:-//Google Inc//Google Calendar 70.9054//EN | 46 | PRODID:-//Google Inc//Google Calendar 70.9054//EN |
| 55 | VERSION:2.0 | 47 | VERSION:2.0 |
| @@ -83,7 +75,7 @@ UID:iipdt88slddpeu7hheuu09sfmd@google.com | |||
| 83 | X-MICROSOFT-CDO-OWNERAPPTID:-362490173 | 75 | X-MICROSOFT-CDO-OWNERAPPTID:-362490173 |
| 84 | RECURRENCE-ID;TZID=America/New_York:20201208T091500 | 76 | RECURRENCE-ID;TZID=America/New_York:20201208T091500 |
| 85 | CREATED:20200309T134939Z | 77 | CREATED:20200309T134939Z |
| 86 | DESCRIPTION:In this meeting\, we will cover topics from product and enginee | 78 | DESCRIPTION:In this meeting\\, we will cover topics from product and enginee |
| 87 | ring presentations and demos to new hire announcements to watching the late | 79 | ring presentations and demos to new hire announcements to watching the late |
| 88 | LAST-MODIFIED:20200728T182852Z | 80 | LAST-MODIFIED:20200728T182852Z |
| 89 | LOCATION:New York-22-Town Hall Space (250) [Chrome Box] | 81 | LOCATION:New York-22-Town Hall Space (250) [Chrome Box] |
| @@ -106,7 +98,7 @@ END:VCALENDAR | |||
| 106 | (with-slots (organizer summary description location end-time uid rsvp participation-type) event | 98 | (with-slots (organizer summary description location end-time uid rsvp participation-type) event |
| 107 | (should (string= organizer "liveintent.com_3bm6fh805bme9uoeliqcle1sag@group.calendar.google.com")) | 99 | (should (string= organizer "liveintent.com_3bm6fh805bme9uoeliqcle1sag@group.calendar.google.com")) |
| 108 | (should (string= summary "Townhall | All Company Meeting")) | 100 | (should (string= summary "Townhall | All Company Meeting")) |
| 109 | (should (string= description "In this meeting\, we will cover topics from product and engineering presentations and demos to new hire announcements to watching the late")) | 101 | (should (string= description "In this meeting, we will cover topics from product and engineering presentations and demos to new hire announcements to watching the late")) |
| 110 | (should (string= location "New York-22-Town Hall Space (250) [Chrome Box]")) | 102 | (should (string= location "New York-22-Town Hall Space (250) [Chrome Box]")) |
| 111 | (should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-12-08 16:00")) | 103 | (should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-12-08 16:00")) |
| 112 | (should (string= uid "iipdt88slddpeu7hheuu09sfmd@google.com")) | 104 | (should (string= uid "iipdt88slddpeu7hheuu09sfmd@google.com")) |
| @@ -117,7 +109,7 @@ END:VCALENDAR | |||
| 117 | (ert-deftest gnus-icalendary-byday () | 109 | (ert-deftest gnus-icalendary-byday () |
| 118 | "" | 110 | "" |
| 119 | (let ((tz (getenv "TZ")) | 111 | (let ((tz (getenv "TZ")) |
| 120 | (event (gnus-icalendar-tests--get-ical-event " | 112 | (event (gnus-icalendar-tests--get-ical-event "\ |
| 121 | BEGIN:VCALENDAR | 113 | BEGIN:VCALENDAR |
| 122 | PRODID:Zimbra-Calendar-Provider | 114 | PRODID:Zimbra-Calendar-Provider |
| 123 | VERSION:2.0 | 115 | VERSION:2.0 |
| @@ -142,7 +134,7 @@ END:VTIMEZONE | |||
| 142 | BEGIN:VEVENT | 134 | BEGIN:VEVENT |
| 143 | UID:903a5415-9067-4f63-b499-1b6205f49c88 | 135 | UID:903a5415-9067-4f63-b499-1b6205f49c88 |
| 144 | RRULE:FREQ=DAILY;UNTIL=20200825T035959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR | 136 | RRULE:FREQ=DAILY;UNTIL=20200825T035959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR |
| 145 | SUMMARY:appointment every weekday\, start jul 24\, 2020\, end aug 24\, 2020 | 137 | SUMMARY:appointment every weekday\\, start jul 24\\, 2020\\, end aug 24\\, 2020 |
| 146 | ATTENDEE;CN=Mark Hershberger;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP | 138 | ATTENDEE;CN=Mark Hershberger;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP |
| 147 | =TRUE:mailto:hexmode <at> gmail.com | 139 | =TRUE:mailto:hexmode <at> gmail.com |
| 148 | ORGANIZER;CN=Mark A. Hershberger:mailto:mah <at> nichework.com | 140 | ORGANIZER;CN=Mark A. Hershberger:mailto:mah <at> nichework.com |
| @@ -175,7 +167,7 @@ END:VCALENDAR" (list "Mark Hershberger")))) | |||
| 175 | (should (string= (gnus-icalendar-event:start event) "2020-07-24 15:00")) | 167 | (should (string= (gnus-icalendar-event:start event) "2020-07-24 15:00")) |
| 176 | (with-slots (organizer summary description location end-time uid rsvp participation-type) event | 168 | (with-slots (organizer summary description location end-time uid rsvp participation-type) event |
| 177 | (should (string= organizer "mah <at> nichework.com")) | 169 | (should (string= organizer "mah <at> nichework.com")) |
| 178 | (should (string= summary "appointment every weekday\, start jul 24\, 2020\, end aug 24\, 2020")) | 170 | (should (string= summary "appointment every weekday, start jul 24, 2020, end aug 24, 2020")) |
| 179 | (should (string= description "The following is a new meeting request:")) | 171 | (should (string= description "The following is a new meeting request:")) |
| 180 | (should (null location)) | 172 | (should (null location)) |
| 181 | (should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-07-24 15:30")) | 173 | (should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-07-24 15:30")) |