1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
| | ;;; gnus-icalendar-tests.el --- tests -*- lexical-binding: t; -*-
;; Copyright (C) 2020-2022 Free Software Foundation, Inc.
;; Author: Jan Tatarik <jan.tatarik@gmail.com>
;; Keywords:
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'ert)
(require 'gnus-icalendar)
(defun gnus-icalendar-tests--get-ical-event (ical-string &optional participant)
"Return gnus-icalendar event for ICAL-STRING."
(let (event)
(with-temp-buffer
(insert ical-string)
(setq event (gnus-icalendar-event-from-buffer (buffer-name) participant)))
event))
(ert-deftest gnus-icalendar-datetimep ()
"Can differentiate between dates and datetimes."
(should
(equal
(gnus-icalendar--datetimep
(parse-time-string "2020-09-15 14:00"))
t))
(should
(equal
(gnus-icalendar--datetimep
(iso8601-parse-date "2020-09-15"))
nil)))
(ert-deftest gnus-icalendar-datep ()
"Can differentiate between dates and datetimes."
(should
(equal
(gnus-icalendar--datep
(iso8601-parse-date "2020-09-15"))
t))
(should
(equal
(gnus-icalendar--datep
(parse-time-string "2020-09-15 14:00"))
nil)))
(ert-deftest gnus-icalendar-parse ()
"test"
(let ((tz (getenv "TZ"))
(event (gnus-icalendar-tests--get-ical-event "\
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:America/New_York
X-LIC-LOCATION:America/New_York
BEGIN:DAYLIGHT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=America/New_York:20201208T090000
DTEND;TZID=America/New_York:20201208T100000
DTSTAMP:20200728T182853Z
ORGANIZER;CN=Company Events:mailto:anoncompany.com_3bm6fh805bme9uoeliqcle1sa
g@group.calendar.google.com
UID:iipdt88slddpeu7hheuu09sfmd@google.com
X-MICROSOFT-CDO-OWNERAPPTID:-362490173
RECURRENCE-ID;TZID=America/New_York:20201208T091500
CREATED:20200309T134939Z
DESCRIPTION:In this meeting\\, we will cover topics from product and enginee
ring presentations and demos to new hire announcements to watching the late
LAST-MODIFIED:20200728T182852Z
LOCATION:New York-22-Town Hall Space (250) [Chrome Box]
SEQUENCE:4
STATUS:CONFIRMED
SUMMARY:Townhall | All Company Meeting
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
")))
(unwind-protect
(progn
;; Use this form so as not to rely on system tz database.
;; Eg hydra.nixos.org.
(setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
(should (eq (eieio-object-class event) 'gnus-icalendar-event-request))
(should (not (gnus-icalendar-event:recurring-p event)))
(should (string= (gnus-icalendar-event:start event) "2020-12-08 15:00"))
(with-slots (organizer summary description location end-time uid rsvp participation-type) event
(should (string= organizer "anoncompany.com_3bm6fh805bme9uoeliqcle1sag@group.calendar.google.com"))
(should (string= summary "Townhall | All Company Meeting"))
(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"))
(should (string= location "New York-22-Town Hall Space (250) [Chrome Box]"))
(should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-12-08 16:00"))
(should (string= uid "iipdt88slddpeu7hheuu09sfmd@google.com"))
(should (not rsvp))
(should (eq participation-type 'non-participant))))
(setenv "TZ" tz))))
(ert-deftest gnus-icalendary-byday ()
""
(let ((tz (getenv "TZ"))
(event (gnus-icalendar-tests--get-ical-event "\
BEGIN:VCALENDAR
PRODID:Zimbra-Calendar-Provider
VERSION:2.0
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:America/New_York
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETTO:-0500
TZOFFSETFROM:-0400
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETTO:-0400
TZOFFSETFROM:-0500
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU
TZNAME:EDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:903a5415-9067-4f63-b499-1b6205f49c88
RRULE:FREQ=DAILY;UNTIL=20200825T035959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
SUMMARY:appointment every weekday\\, start jul 24\\, 2020\\, end aug 24\\, 2020
ATTENDEE;CN=Mark Hershberger;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP
=TRUE:mailto:hexmode <at> gmail.com
ORGANIZER;CN=Mark A. Hershberger:mailto:mah <at> nichework.com
DTSTART;TZID=\"America/New_York\":20200724T090000
DTEND;TZID=\"America/New_York\":20200724T093000
STATUS:CONFIRMED
CLASS:PUBLIC
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
TRANSP:OPAQUE
LAST-MODIFIED:20200719T150815Z
DTSTAMP:20200719T150815Z
SEQUENCE:0
DESCRIPTION:The following is a new meeting request:
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;RELATED=START:-PT5M
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR" (list "Mark Hershberger"))))
(unwind-protect
(progn
;; Use this form so as not to rely on system tz database.
;; Eg hydra.nixos.org.
(setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
(should (eq (eieio-object-class event) 'gnus-icalendar-event-request))
(should (gnus-icalendar-event:recurring-p event))
(should (string= (gnus-icalendar-event:recurring-interval event) "1"))
(should (string= (gnus-icalendar-event:start event) "2020-07-24 15:00"))
(with-slots (organizer summary description location end-time uid rsvp participation-type) event
(should (string= organizer "mah <at> nichework.com"))
(should (string= summary "appointment every weekday, start jul 24, 2020, end aug 24, 2020"))
(should (string= description "The following is a new meeting request:"))
(should (null location))
(should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-07-24 15:30"))
(should (string= uid "903a5415-9067-4f63-b499-1b6205f49c88"))
(should rsvp)
(should (eq participation-type 'required)))
(should (equal (gnus-icalendar-event:recurring-days event) '(1 2 3 4 5)))
(should (string= (gnus-icalendar-event:org-timestamp event) "<2020-07-24 15:00-15:30 +1w>
<2020-07-27 15:00-15:30 +1w>
<2020-07-28 15:00-15:30 +1w>
<2020-07-29 15:00-15:30 +1w>
<2020-07-30 15:00-15:30 +1w>")))
(setenv "TZ" tz))))
(ert-deftest gnus-icalendary-weekly-byday ()
""
(let ((tz (getenv "TZ"))
(event (gnus-icalendar-tests--get-ical-event "\
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Europe/Berlin:20200915T140000
DTEND;TZID=Europe/Berlin:20200915T143000
RRULE:FREQ=WEEKLY;BYDAY=FR,MO,TH,TU,WE
DTSTAMP:20200915T120627Z
ORGANIZER;CN=anon@anoncompany.com:mailto:anon@anoncompany.com
UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=participant@anoncompany.com;X-NUM-GUESTS=0:mailto:participant@anoncompany.com
CREATED:20200325T095723Z
DESCRIPTION:Coffee talk
LAST-MODIFIED:20200915T120623Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Casual coffee talk
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR" (list "participant@anoncompany.com"))))
(unwind-protect
(progn
;; Use this form so as not to rely on system tz database.
;; Eg hydra.nixos.org.
(setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
(should (eq (eieio-object-class event) 'gnus-icalendar-event-request))
(should (gnus-icalendar-event:recurring-p event))
(should (string= (gnus-icalendar-event:recurring-interval event) "1"))
(should (string= (gnus-icalendar-event:start event) "2020-09-15 14:00"))
(with-slots (organizer summary description location end-time uid rsvp participation-type) event
(should (string= organizer "anon@anoncompany.com"))
(should (string= summary "Casual coffee talk"))
(should (string= description "Coffee talk"))
(should (string= location ""))
(should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-09-15 14:30"))
(should (string= uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com"))
(should rsvp)
(should (eq participation-type 'required)))
(should (equal (sort (gnus-icalendar-event:recurring-days event) #'<) '(1 2 3 4 5)))
(should (string= (gnus-icalendar-event:org-timestamp event) "<2020-09-15 14:00-14:30 +1w>
<2020-09-16 14:00-14:30 +1w>
<2020-09-17 14:00-14:30 +1w>
<2020-09-18 14:00-14:30 +1w>
<2020-09-21 14:00-14:30 +1w>")))
(setenv "TZ" tz))))
(ert-deftest gnus-icalendar-dtstart-duration ()
""
(let ((tz (getenv "TZ"))
(event (gnus-icalendar-tests--get-ical-event "\
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Europe/Berlin:20200915T140000
DURATION:PT3H
RRULE:FREQ=WEEKLY;BYDAY=FR,MO,TH,TU,WE
DTSTAMP:20200915T120627Z
ORGANIZER;CN=anon@anoncompany.com:mailto:anon@anoncompany.com
UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=participant@anoncompany.com;X-NUM-GUESTS=0:mailto:participant@anoncompany.com
CREATED:20200325T095723Z
DESCRIPTION:Coffee talk
LAST-MODIFIED:20200915T120623Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Casual coffee talk
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR" (list "participant@anoncompany.com"))))
(unwind-protect
(progn
;; Use this form so as not to rely on system tz database.
;; Eg hydra.nixos.org.
(setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
(should (eq (eieio-object-class event) 'gnus-icalendar-event-request))
(should (gnus-icalendar-event:recurring-p event))
(should (string= (gnus-icalendar-event:recurring-interval event) "1"))
(should (string= (gnus-icalendar-event:start event) "2020-09-15 14:00"))
(should (string= (gnus-icalendar-event:end event) "2020-09-15 17:00"))
(with-slots (organizer summary description location end-time uid rsvp participation-type) event
(should (string= organizer "anon@anoncompany.com"))
(should (string= summary "Casual coffee talk"))
(should (string= description "Coffee talk"))
(should (string= location ""))
(should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-09-15 17:00"))
(should (string= uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com"))
(should rsvp)
(should (eq participation-type 'required)))
(should (equal (sort (gnus-icalendar-event:recurring-days event) #'<) '(1 2 3 4 5)))
(should (string= (gnus-icalendar-event:org-timestamp event) "<2020-09-15 14:00-17:00 +1w>
<2020-09-16 14:00-17:00 +1w>
<2020-09-17 14:00-17:00 +1w>
<2020-09-18 14:00-17:00 +1w>
<2020-09-21 14:00-17:00 +1w>"))
)
(setenv "TZ" tz))))
(ert-deftest gnus-icalendar-dtstart-only-datetime ()
""
(let ((tz (getenv "TZ"))
(event (gnus-icalendar-tests--get-ical-event "\
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Europe/Berlin:20200915T140000
RRULE:FREQ=WEEKLY;BYDAY=FR,MO,TH,TU,WE
DTSTAMP:20200915T120627Z
ORGANIZER;CN=anon@anoncompany.com:mailto:anon@anoncompany.com
UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=participant@anoncompany.com;X-NUM-GUESTS=0:mailto:participant@anoncompany.com
CREATED:20200325T095723Z
DESCRIPTION:Coffee talk
LAST-MODIFIED:20200915T120623Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Casual coffee talk
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR" (list "participant@anoncompany.com"))))
(unwind-protect
(progn
;; Use this form so as not to rely on system tz database.
;; Eg hydra.nixos.org.
(setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
(should (eq (eieio-object-class event) 'gnus-icalendar-event-request))
(should (gnus-icalendar-event:recurring-p event))
(should (string= (gnus-icalendar-event:recurring-interval event) "1"))
(should (string= (gnus-icalendar-event:start event) "2020-09-15 14:00"))
;; For cases where a "VEVENT" calendar component specifies a
;; "DTSTART" property with a DATE-TIME value type but no
;; "DTEND" property, the event ends on the same calendar
;; date and time of day specified by the "DTSTART" property.
(should (string= (gnus-icalendar-event:end event) "2020-09-15 14:00"))
(with-slots (organizer summary description location end-time uid rsvp participation-type) event
(should (string= organizer "anon@anoncompany.com"))
(should (string= summary "Casual coffee talk"))
(should (string= description "Coffee talk"))
(should (string= location ""))
(should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-09-15 14:00"))
(should (string= uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com"))
(should rsvp)
(should (eq participation-type 'required)))
(should (equal (sort (gnus-icalendar-event:recurring-days event) #'<) '(1 2 3 4 5)))
(should (string= (gnus-icalendar-event:org-timestamp event) "<2020-09-15 14:00-14:00 +1w>
<2020-09-16 14:00-14:00 +1w>
<2020-09-17 14:00-14:00 +1w>
<2020-09-18 14:00-14:00 +1w>
<2020-09-21 14:00-14:00 +1w>"))
)
(setenv "TZ" tz))))
(ert-deftest gnus-icalendar-dtstart-only-date ()
""
(let ((tz (getenv "TZ"))
(event (gnus-icalendar-tests--get-ical-event "\
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Europe/Berlin:20200915
RRULE:FREQ=WEEKLY;BYDAY=FR,MO,TH,TU,WE
DTSTAMP:20200915T120627Z
ORGANIZER;CN=anon@anoncompany.com:mailto:anon@anoncompany.com
UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=participant@anoncompany.com;X-NUM-GUESTS=0:mailto:participant@anoncompany.com
CREATED:20200325T095723Z
DESCRIPTION:Coffee talk
LAST-MODIFIED:20200915T120623Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Casual coffee talk
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR" (list "participant@anoncompany.com"))))
(unwind-protect
(progn
;; Use this form so as not to rely on system tz database.
;; Eg hydra.nixos.org.
(setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
(should (eq (eieio-object-class event) 'gnus-icalendar-event-request))
(should (gnus-icalendar-event:recurring-p event))
(should (string= (gnus-icalendar-event:recurring-interval event) "1"))
(should (string= (gnus-icalendar-event:start event) "2020-09-15 00:00"))
;; For cases where a "VEVENT" calendar component
;; specifies a "DTSTART" property with a DATE value type but no
;; "DTEND" nor "DURATION" property, the event's duration is taken to
;; be one day.
(should (string= (gnus-icalendar-event:end event) "2020-09-16 00:00"))
(with-slots (organizer summary description location end-time uid rsvp participation-type) event
(should (string= organizer "anon@anoncompany.com"))
(should (string= summary "Casual coffee talk"))
(should (string= description "Coffee talk"))
(should (string= location ""))
(should (string= (format-time-string "%Y-%m-%d %H:%M" end-time) "2020-09-16 00:00"))
(should (string= uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@google.com"))
(should rsvp)
(should (eq participation-type 'required)))
(should (equal (sort (gnus-icalendar-event:recurring-days event) #'<) '(1 2 3 4 5)))
(should (string= (gnus-icalendar-event:org-timestamp event) "<2020-09-15 00:00-00:00 +1w>
<2020-09-16 00:00-00:00 +1w>
<2020-09-17 00:00-00:00 +1w>
<2020-09-18 00:00-00:00 +1w>
<2020-09-21 00:00-00:00 +1w>"))
)
(setenv "TZ" tz))))
(provide 'gnus-icalendar-tests)
;;; gnus-icalendar-tests.el ends here
|