aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-08-26 10:34:29 +0200
committerMattias EngdegÄrd2020-08-26 10:48:44 +0200
commit1926fe6527ac5c3220dd736a2a1a9643f11d8220 (patch)
treea89499df3976de4eec84d0e0a06201a38a55939e
parente823709d1755cb4fd087f2a9ba92d350dd32fe47 (diff)
downloademacs-1926fe6527ac5c3220dd736a2a1a9643f11d8220.tar.gz
emacs-1926fe6527ac5c3220dd736a2a1a9643f11d8220.zip
Fix lexical misunderstandings in gnus-icalendar-tests.el (bug#39782)
* test/lisp/gnus/gnus-icalendar-tests.el: (icalendar-tests--get-ical-event): Remove unused function accidentally copy-pasted from icalendar-tests.el. (gnus-icalendar-parse, gnus-icalendary-byday): Remove unintended initial newlines. Duplicate comma-escaping backslashes so that they have intended effects, conforming to RFC 5545. Remove ineffective comma-escaping backslashes where not intended.
-rw-r--r--test/lisp/gnus/gnus-icalendar-tests.el20
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 "\
53BEGIN:VCALENDAR 45BEGIN:VCALENDAR
54PRODID:-//Google Inc//Google Calendar 70.9054//EN 46PRODID:-//Google Inc//Google Calendar 70.9054//EN
55VERSION:2.0 47VERSION:2.0
@@ -83,7 +75,7 @@ UID:iipdt88slddpeu7hheuu09sfmd@google.com
83X-MICROSOFT-CDO-OWNERAPPTID:-362490173 75X-MICROSOFT-CDO-OWNERAPPTID:-362490173
84RECURRENCE-ID;TZID=America/New_York:20201208T091500 76RECURRENCE-ID;TZID=America/New_York:20201208T091500
85CREATED:20200309T134939Z 77CREATED:20200309T134939Z
86DESCRIPTION:In this meeting\, we will cover topics from product and enginee 78DESCRIPTION: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
88LAST-MODIFIED:20200728T182852Z 80LAST-MODIFIED:20200728T182852Z
89LOCATION:New York-22-Town Hall Space (250) [Chrome Box] 81LOCATION: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 "\
121BEGIN:VCALENDAR 113BEGIN:VCALENDAR
122PRODID:Zimbra-Calendar-Provider 114PRODID:Zimbra-Calendar-Provider
123VERSION:2.0 115VERSION:2.0
@@ -142,7 +134,7 @@ END:VTIMEZONE
142BEGIN:VEVENT 134BEGIN:VEVENT
143UID:903a5415-9067-4f63-b499-1b6205f49c88 135UID:903a5415-9067-4f63-b499-1b6205f49c88
144RRULE:FREQ=DAILY;UNTIL=20200825T035959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR 136RRULE:FREQ=DAILY;UNTIL=20200825T035959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
145SUMMARY:appointment every weekday\, start jul 24\, 2020\, end aug 24\, 2020 137SUMMARY:appointment every weekday\\, start jul 24\\, 2020\\, end aug 24\\, 2020
146ATTENDEE;CN=Mark Hershberger;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP 138ATTENDEE;CN=Mark Hershberger;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP
147 =TRUE:mailto:hexmode <at> gmail.com 139 =TRUE:mailto:hexmode <at> gmail.com
148ORGANIZER;CN=Mark A. Hershberger:mailto:mah <at> nichework.com 140ORGANIZER;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"))