]> code.delx.au - gnu-emacs/blob - test/automated/icalendar-tests.el
2ffa3911ee316558b3333b6a5b81ec8024d0645d
[gnu-emacs] / test / automated / icalendar-tests.el
1 ;; icalendar-tests.el --- Test suite for icalendar.el
2
3 ;; Copyright (C) 2005, 2008-2014 Free Software Foundation, Inc.
4
5 ;; Author: Ulf Jasper <ulf.jasper@web.de>
6 ;; Created: March 2005
7 ;; Keywords: calendar
8 ;; Human-Keywords: calendar, diary, iCalendar, vCalendar
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25 ;;; Commentary:
26
27 ;; TODO:
28 ;; - Add more unit tests for functions, timezone etc.
29
30 ;; Note: Watch the trailing blank that is added on import.
31
32 ;;; Code:
33
34 (require 'ert)
35 (require 'icalendar)
36
37 ;; ======================================================================
38 ;; Helpers
39 ;; ======================================================================
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 (defun icalendar-tests--trim (string)
50 "Remove leading and trailing whitespace from STRING."
51 (replace-regexp-in-string "[ \t\n]+\\'" ""
52 (replace-regexp-in-string "\\`[ \t\n]+" "" string)))
53
54 ;; ======================================================================
55 ;; Tests of functions
56 ;; ======================================================================
57
58 (ert-deftest icalendar--create-uid ()
59 "Test for `icalendar--create-uid'."
60 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
61 t-ct
62 (icalendar--uid-count 77)
63 (entry-full "30.06.1964 07:01 blahblah")
64 (hash (format "%d" (abs (sxhash entry-full))))
65 (contents "DTSTART:19640630T070100\nblahblah")
66 (username (or user-login-name "UNKNOWN_USER"))
67 )
68 (fset 't-ct (symbol-function 'current-time))
69 (unwind-protect
70 (progn
71 (fset 'current-time (lambda () '(1 2 3)))
72 (should (= 77 icalendar--uid-count))
73 (should (string= (concat "xxx-123-77-" hash "-" username "-19640630")
74 (icalendar--create-uid entry-full contents)))
75 (should (= 78 icalendar--uid-count)))
76 ;; restore 'current-time
77 (fset 'current-time (symbol-function 't-ct)))
78 (setq contents "blahblah")
79 (setq icalendar-uid-format "yyy%syyy")
80 (should (string= (concat "yyyDTSTARTyyy")
81 (icalendar--create-uid entry-full contents)))))
82
83 (ert-deftest icalendar--calendar-style ()
84 "Test for `icalendar--date-style'."
85 (dolist (calendar-date-style '(iso american european))
86 (should (eq (icalendar--date-style) calendar-date-style)))
87 (let ((cds calendar-date-style)
88 (european-calendar-style t))
89 (makunbound 'calendar-date-style)
90 (should (eq (icalendar--date-style) 'european))
91 (with-no-warnings (setq european-calendar-style nil)) ;still get warning!?! FIXME
92 (should (eq (icalendar--date-style) 'american))
93 (setq calendar-date-style cds)))
94
95 (ert-deftest icalendar-convert-anniversary-to-ical ()
96 "Test method for `icalendar--convert-anniversary-to-ical'."
97 (let* ((calendar-date-style 'iso)
98 result)
99 (setq result (icalendar--convert-anniversary-to-ical
100 "" "%%(diary-anniversary 1964 6 30) g"))
101 (should (= 2 (length result)))
102 (should (string= (concat
103 "\nDTSTART;VALUE=DATE:19640630"
104 "\nDTEND;VALUE=DATE:19640701"
105 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=30")
106 (car result)))
107 (should (string= "g" (cadr result)))))
108
109 (ert-deftest icalendar--convert-cyclic-to-ical ()
110 "Test method for `icalendar--convert-cyclic-to-ical'."
111 (let* ((calendar-date-style 'iso)
112 result)
113 (setq result (icalendar--convert-block-to-ical
114 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
115 (should (= 2 (length result)))
116 (should (string= (concat
117 "\nDTSTART;VALUE=DATE:20040719"
118 "\nDTEND;VALUE=DATE:20040828")
119 (car result)))
120 (should (string= "Sommerferien" (cadr result)))))
121
122 (ert-deftest icalendar--convert-block-to-ical ()
123 "Test method for `icalendar--convert-block-to-ical'."
124 (let* ((calendar-date-style 'iso)
125 result)
126 (setq result (icalendar--convert-block-to-ical
127 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
128 (should (= 2 (length result)))
129 (should (string= (concat
130 "\nDTSTART;VALUE=DATE:20040719"
131 "\nDTEND;VALUE=DATE:20040828")
132 (car result)))
133 (should (string= "Sommerferien" (cadr result)))))
134
135 (ert-deftest icalendar--convert-yearly-to-ical ()
136 "Test method for `icalendar--convert-yearly-to-ical'."
137 (let* ((calendar-date-style 'iso)
138 result
139 (calendar-month-name-array
140 ["January" "February" "March" "April" "May" "June" "July" "August"
141 "September" "October" "November" "December"]))
142 (setq result (icalendar--convert-yearly-to-ical "" "May 1 Tag der Arbeit"))
143 (should (= 2 (length result)))
144 (should (string= (concat
145 "\nDTSTART;VALUE=DATE:19000501"
146 "\nDTEND;VALUE=DATE:19000502"
147 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1")
148 (car result)))
149 (should (string= "Tag der Arbeit" (cadr result)))))
150
151 (ert-deftest icalendar--convert-weekly-to-ical ()
152 "Test method for `icalendar--convert-weekly-to-ical'."
153 (let* ((calendar-date-style 'iso)
154 result
155 (calendar-day-name-array
156 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
157 "Saturday"]))
158 (setq result (icalendar--convert-weekly-to-ical "" "Monday 8:30 subject"))
159 (should (= 2 (length result)))
160 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20050103T083000"
161 "\nDTEND;VALUE=DATE-TIME:20050103T093000"
162 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO")
163 (car result)))
164 (should (string= "subject" (cadr result)))))
165
166 (ert-deftest icalendar--parse-vtimezone ()
167 "Test method for `icalendar--parse-vtimezone'."
168 (let (vtimezone result)
169 (setq vtimezone (icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
170 TZID:thename
171 BEGIN:STANDARD
172 DTSTART:16010101T040000
173 TZOFFSETFROM:+0300
174 TZOFFSETTO:+0200
175 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
176 END:STANDARD
177 BEGIN:DAYLIGHT
178 DTSTART:16010101T030000
179 TZOFFSETFROM:+0200
180 TZOFFSETTO:+0300
181 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
182 END:DAYLIGHT
183 END:VTIMEZONE
184 "))
185 (setq result (icalendar--parse-vtimezone vtimezone))
186 (should (string= "thename" (car result)))
187 (message (cdr result))
188 (should (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00"
189 (cdr result)))
190 (setq vtimezone (icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
191 TZID:anothername\, with a comma
192 BEGIN:STANDARD
193 DTSTART:16010101T040000
194 TZOFFSETFROM:+0300
195 TZOFFSETTO:+0200
196 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
197 END:STANDARD
198 BEGIN:DAYLIGHT
199 DTSTART:16010101T030000
200 TZOFFSETFROM:+0200
201 TZOFFSETTO:+0300
202 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
203 END:DAYLIGHT
204 END:VTIMEZONE
205 "))
206 (setq result (icalendar--parse-vtimezone vtimezone))
207 (should (string= "anothername, with a comma" (car result)))
208 (message (cdr result))
209 (should (string= "STD-02:00DST-03:00,M3.2.1/03:00:00,M10.2.1/04:00:00"
210 (cdr result)))))
211
212 (ert-deftest icalendar--convert-ordinary-to-ical ()
213 "Test method for `icalendar--convert-ordinary-to-ical'."
214 (let* ((calendar-date-style 'iso)
215 result)
216 ;; without time
217 (setq result (icalendar--convert-ordinary-to-ical "&?" "2010 2 15 subject"))
218 (should (= 2 (length result)))
219 (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216"
220 (car result)))
221 (should (string= "subject" (cadr result)))
222
223 ;; with time
224 (setq result (icalendar--convert-ordinary-to-ical
225 "&?" "&2010 2 15 12:34-23:45 s"))
226 (should (= 2 (length result)))
227 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
228 "\nDTEND;VALUE=DATE-TIME:20100215T234500")
229 (car result)))
230 (should (string= "s" (cadr result)))
231
232 ;; with time, again -- test bug#5549
233 (setq result (icalendar--convert-ordinary-to-ical
234 "x?" "x2010 2 15 0:34-1:45 s"))
235 (should (= 2 (length result)))
236 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400"
237 "\nDTEND;VALUE=DATE-TIME:20100215T014500")
238 (car result)))
239 (should (string= "s" (cadr result)))))
240
241 (ert-deftest icalendar--diarytime-to-isotime ()
242 "Test method for `icalendar--diarytime-to-isotime'."
243 (should (string= "T011500"
244 (icalendar--diarytime-to-isotime "01:15" "")))
245 (should (string= "T011500"
246 (icalendar--diarytime-to-isotime "1:15" "")))
247 (should (string= "T000100"
248 (icalendar--diarytime-to-isotime "0:01" "")))
249 (should (string= "T010000"
250 (icalendar--diarytime-to-isotime "0100" "")))
251 (should (string= "T010000"
252 (icalendar--diarytime-to-isotime "0100" "am")))
253 (should (string= "T130000"
254 (icalendar--diarytime-to-isotime "0100" "pm")))
255 (should (string= "T120000"
256 (icalendar--diarytime-to-isotime "1200" "")))
257 (should (string= "T171700"
258 (icalendar--diarytime-to-isotime "17:17" "")))
259 (should (string= "T000000"
260 (icalendar--diarytime-to-isotime "1200" "am")))
261 (should (string= "T000100"
262 (icalendar--diarytime-to-isotime "1201" "am")))
263 (should (string= "T005900"
264 (icalendar--diarytime-to-isotime "1259" "am")))
265 (should (string= "T120000"
266 (icalendar--diarytime-to-isotime "1200" "pm")))
267 (should (string= "T120100"
268 (icalendar--diarytime-to-isotime "1201" "pm")))
269 (should (string= "T125900"
270 (icalendar--diarytime-to-isotime "1259" "pm"))))
271
272 (ert-deftest icalendar--datetime-to-diary-date ()
273 "Test method for `icalendar--datetime-to-diary-date'."
274 (let* ((datetime '(59 59 23 31 12 2008))
275 (calendar-date-style 'iso))
276 (should (string= "2008 12 31"
277 (icalendar--datetime-to-diary-date datetime)))
278 (setq calendar-date-style 'european)
279 (should (string= "31 12 2008"
280 (icalendar--datetime-to-diary-date datetime)))
281 (setq calendar-date-style 'american)
282 (should (string= "12 31 2008"
283 (icalendar--datetime-to-diary-date datetime)))))
284
285 (ert-deftest icalendar--datestring-to-isodate ()
286 "Test method for `icalendar--datestring-to-isodate'."
287 (let ((calendar-date-style 'iso))
288 ;; numeric iso
289 (should (string= "20080511"
290 (icalendar--datestring-to-isodate "2008 05 11")))
291 (should (string= "20080531"
292 (icalendar--datestring-to-isodate "2008 05 31")))
293 (should (string= "20080602"
294 (icalendar--datestring-to-isodate "2008 05 31" 2)))
295
296 ;; numeric european
297 (setq calendar-date-style 'european)
298 (should (string= "20080511"
299 (icalendar--datestring-to-isodate "11 05 2008")))
300 (should (string= "20080531"
301 (icalendar--datestring-to-isodate "31 05 2008")))
302 (should (string= "20080602"
303 (icalendar--datestring-to-isodate "31 05 2008" 2)))
304
305 ;; numeric american
306 (setq calendar-date-style 'american)
307 (should (string= "20081105"
308 (icalendar--datestring-to-isodate "11 05 2008")))
309 (should (string= "20081230"
310 (icalendar--datestring-to-isodate "12 30 2008")))
311 (should (string= "20090101"
312 (icalendar--datestring-to-isodate "12 30 2008" 2)))
313
314 ;; non-numeric
315 (setq calendar-date-style nil) ;not necessary for conversion
316 (should (string= "20081105"
317 (icalendar--datestring-to-isodate "Nov 05 2008")))
318 (should (string= "20081105"
319 (icalendar--datestring-to-isodate "05 Nov 2008")))
320 (should (string= "20081105"
321 (icalendar--datestring-to-isodate "2008 Nov 05")))))
322
323 (ert-deftest icalendar--first-weekday-of-year ()
324 "Test method for `icalendar-first-weekday-of-year'."
325 (should (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
326 (should (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
327 (should (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
328 (should (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
329 (should (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
330 (should (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
331 (should (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
332 (should (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
333 (should (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
334
335 (ert-deftest icalendar--import-format-sample ()
336 "Test method for `icalendar-import-format-sample'."
337 (should (string= (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
338 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'")
339 (icalendar-import-format-sample
340 (icalendar-tests--get-ical-event "BEGIN:VEVENT
341 DTSTAMP:20030509T043439Z
342 DTSTART:20030509T103000
343 SUMMARY:a
344 ORGANIZER:d
345 LOCATION:c
346 DTEND:20030509T153000
347 DESCRIPTION:b
348 END:VEVENT
349 ")))))
350
351 (ert-deftest icalendar--format-ical-event ()
352 "Test `icalendar--format-ical-event'."
353 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
354 (icalendar-import-format-summary "SUM %s")
355 (icalendar-import-format-location " LOC %s")
356 (icalendar-import-format-description " DES %s")
357 (icalendar-import-format-organizer " ORG %s")
358 (icalendar-import-format-status " STA %s")
359 (icalendar-import-format-url " URL %s")
360 (icalendar-import-format-class " CLA %s")
361 (event (icalendar-tests--get-ical-event "BEGIN:VEVENT
362 DTSTAMP:20030509T043439Z
363 DTSTART:20030509T103000
364 SUMMARY:sum
365 ORGANIZER:org
366 LOCATION:loc
367 DTEND:20030509T153000
368 DESCRIPTION:des
369 END:VEVENT
370 ")))
371 (should (string= "SUM sum DES des LOC loc ORG org"
372 (icalendar--format-ical-event event)))
373 (setq icalendar-import-format (lambda (&rest ignore)
374 "helloworld"))
375 (should (string= "helloworld" (icalendar--format-ical-event event)))
376 (setq icalendar-import-format
377 (lambda (e)
378 (format "-%s-%s-%s-%s-%s-%s-%s-"
379 (icalendar--get-event-property event 'SUMMARY)
380 (icalendar--get-event-property event 'DESCRIPTION)
381 (icalendar--get-event-property event 'LOCATION)
382 (icalendar--get-event-property event 'ORGANIZER)
383 (icalendar--get-event-property event 'STATUS)
384 (icalendar--get-event-property event 'URL)
385 (icalendar--get-event-property event 'CLASS))))
386 (should (string= "-sum-des-loc-org-nil-nil-nil-"
387 (icalendar--format-ical-event event)))))
388
389 (ert-deftest icalendar--parse-summary-and-rest ()
390 "Test `icalendar--parse-summary-and-rest'."
391 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
392 (icalendar-import-format-summary "SUM %s")
393 (icalendar-import-format-location " LOC %s")
394 (icalendar-import-format-description " DES %s")
395 (icalendar-import-format-organizer " ORG %s")
396 (icalendar-import-format-status " STA %s")
397 (icalendar-import-format-url " URL %s")
398 (icalendar-import-format-class " CLA %s")
399 (result))
400 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org"))
401 (should (string= "org" (cdr (assoc 'org result))))
402
403 (setq result (icalendar--parse-summary-and-rest
404 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
405 (should (string= "des" (cdr (assoc 'des result))))
406 (should (string= "loc" (cdr (assoc 'loc result))))
407 (should (string= "org" (cdr (assoc 'org result))))
408 (should (string= "sta" (cdr (assoc 'sta result))))
409 (should (string= "cla" (cdr (assoc 'cla result))))
410
411 (setq icalendar-import-format (lambda () "Hello world"))
412 (setq result (icalendar--parse-summary-and-rest
413 "blah blah "))
414 (should (not result))
415 ))
416
417 (ert-deftest icalendar--decode-isodatetime ()
418 "Test `icalendar--decode-isodatetime'."
419 (let ((tz (getenv "TZ"))
420 result)
421 (unwind-protect
422 (progn
423 ;; Use Eastern European Time (UTC+1, UTC+2 daylight saving)
424 (setenv "TZ" "EET")
425
426 (message "%s" (current-time-zone (encode-time 0 0 10 1 1 2013 0)))
427 (message "%s" (current-time-zone (encode-time 0 0 10 1 8 2013 0)))
428
429 ;; testcase: no time zone in input -> keep time as is
430 ;; 1 Jan 2013 10:00
431 (should (equal '(0 0 10 1 1 2013 2 nil 7200)
432 (icalendar--decode-isodatetime "20130101T100000")))
433 ;; 1 Aug 2013 10:00 (DST)
434 (should (equal '(0 0 10 1 8 2013 4 t 10800)
435 (icalendar--decode-isodatetime "20130801T100000")))
436
437 ;; testcase: UTC time zone specifier in input -> convert to local time
438 ;; 31 Dec 2013 23:00 UTC -> 1 Jan 2013 01:00 EET
439 (should (equal '(0 0 1 1 1 2014 3 nil 7200)
440 (icalendar--decode-isodatetime "20131231T230000Z")))
441 ;; 1 Aug 2013 10:00 UTC -> 1 Aug 2013 13:00 EEST
442 (should (equal '(0 0 13 1 8 2013 4 t 10800)
443 (icalendar--decode-isodatetime "20130801T100000Z")))
444
445 )
446 ;; restore time-zone even if something went terribly wrong
447 (setenv "TZ" tz))) )
448
449 ;; ======================================================================
450 ;; Export tests
451 ;; ======================================================================
452
453 (defun icalendar-tests--test-export (input-iso input-european input-american
454 expected-output)
455 "Perform an export test.
456 Argument INPUT-ISO iso style diary string.
457 Argument INPUT-EUROPEAN european style diary string.
458 Argument INPUT-AMERICAN american style diary string.
459 Argument EXPECTED-OUTPUT expected iCalendar result string.
460
461 European style input data must use german month names. American
462 and ISO style input data must use english month names."
463 (let ((tz (getenv "TZ"))
464 (calendar-date-style 'iso)
465 (icalendar-recurring-start-year 2000))
466 (unwind-protect
467 (progn
468 ;;; (message "Current time zone: %s" (current-time-zone))
469 ;; Use this form so as not to rely on system tz database.
470 ;; Eg hydra.nixos.org.
471 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
472 ;;; (message "Current time zone: %s" (current-time-zone))
473 (when input-iso
474 (let ((calendar-month-name-array
475 ["January" "February" "March" "April" "May" "June" "July" "August"
476 "September" "October" "November" "December"])
477 (calendar-day-name-array
478 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
479 "Saturday"]))
480 (setq calendar-date-style 'iso)
481 (icalendar-tests--do-test-export input-iso expected-output)))
482 (when input-european
483 (let ((calendar-month-name-array
484 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
485 "September" "Oktober" "November" "Dezember"])
486 (calendar-day-name-array
487 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
488 "Samstag"]))
489 (setq calendar-date-style 'european)
490 (icalendar-tests--do-test-export input-european expected-output)))
491 (when input-american
492 (let ((calendar-month-name-array
493 ["January" "February" "March" "April" "May" "June" "July" "August"
494 "September" "October" "November" "December"])
495 (calendar-day-name-array
496 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
497 "Saturday"]))
498 (setq calendar-date-style 'american)
499 (icalendar-tests--do-test-export input-american expected-output))))
500 ;; restore time-zone even if something went terribly wrong
501 (setenv "TZ" tz))))
502
503 (defun icalendar-tests--do-test-export (input expected-output)
504 "Actually perform export test.
505 Argument INPUT input diary string.
506 Argument EXPECTED-OUTPUT expected iCalendar result string."
507 (let ((temp-file (make-temp-file "icalendar-tests-ics")))
508 (unwind-protect
509 (progn
510 (with-temp-buffer
511 (insert input)
512 (icalendar-export-region (point-min) (point-max) temp-file))
513 (save-excursion
514 (find-file temp-file)
515 (goto-char (point-min))
516 (cond (expected-output
517 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
518 PRODID:-//Emacs//NONSGML icalendar.el//EN
519 VERSION:2.0
520 BEGIN:VEVENT
521 UID:emacs[0-9]+
522 \\(\\(.\\|\n\\)+\\)
523 END:VEVENT
524 END:VCALENDAR
525 \\s-*$"
526 nil t))
527 (should (string-match
528 (concat "^\\s-*"
529 (regexp-quote (buffer-substring-no-properties
530 (match-beginning 1) (match-end 1)))
531 "\\s-*$")
532 expected-output)))
533 (t
534 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
535 PRODID:-//Emacs//NONSGML icalendar.el//EN
536 VERSION:2.0
537 END:VCALENDAR
538 \\s-*$"
539 nil t))))))
540 ;; cleanup!!
541 (kill-buffer (find-buffer-visiting temp-file))
542 (delete-file temp-file))))
543
544 (ert-deftest icalendar-export-ordinary-no-time ()
545 "Perform export test."
546
547 (let ((icalendar-export-hidden-diary-entries nil))
548 (icalendar-tests--test-export
549 "&2000 Oct 3 ordinary no time "
550 "&3 Okt 2000 ordinary no time "
551 "&Oct 3 2000 ordinary no time "
552 nil))
553
554 (icalendar-tests--test-export
555 "2000 Oct 3 ordinary no time "
556 "3 Okt 2000 ordinary no time "
557 "Oct 3 2000 ordinary no time "
558 "DTSTART;VALUE=DATE:20001003
559 DTEND;VALUE=DATE:20001004
560 SUMMARY:ordinary no time
561 "))
562
563 (ert-deftest icalendar-export-ordinary ()
564 "Perform export test."
565
566 (icalendar-tests--test-export
567 "2000 Oct 3 16:30 ordinary with time"
568 "3 Okt 2000 16:30 ordinary with time"
569 "Oct 3 2000 16:30 ordinary with time"
570 "DTSTART;VALUE=DATE-TIME:20001003T163000
571 DTEND;VALUE=DATE-TIME:20001003T173000
572 SUMMARY:ordinary with time
573 ")
574 (icalendar-tests--test-export
575 "2000 10 3 16:30 ordinary with time 2"
576 "3 10 2000 16:30 ordinary with time 2"
577 "10 3 2000 16:30 ordinary with time 2"
578 "DTSTART;VALUE=DATE-TIME:20001003T163000
579 DTEND;VALUE=DATE-TIME:20001003T173000
580 SUMMARY:ordinary with time 2
581 ")
582
583 (icalendar-tests--test-export
584 "2000/10/3 16:30 ordinary with time 3"
585 "3/10/2000 16:30 ordinary with time 3"
586 "10/3/2000 16:30 ordinary with time 3"
587 "DTSTART;VALUE=DATE-TIME:20001003T163000
588 DTEND;VALUE=DATE-TIME:20001003T173000
589 SUMMARY:ordinary with time 3
590 "))
591
592 (ert-deftest icalendar-export-multiline ()
593 "Perform export test."
594
595 ;; multiline -- FIXME!!!
596 (icalendar-tests--test-export
597 "2000 October 3 16:30 multiline
598 17:30 multiline continued FIXME"
599 "3 Oktober 2000 16:30 multiline
600 17:30 multiline continued FIXME"
601 "October 3 2000 16:30 multiline
602 17:30 multiline continued FIXME"
603 "DTSTART;VALUE=DATE-TIME:20001003T163000
604 DTEND;VALUE=DATE-TIME:20001003T173000
605 SUMMARY:multiline
606 DESCRIPTION:
607 17:30 multiline continued FIXME
608 "))
609
610 (ert-deftest icalendar-export-weekly-by-day ()
611 "Perform export test."
612
613 ;; weekly by day
614 (icalendar-tests--test-export
615 "Monday 1:30pm weekly by day with start time"
616 "Montag 13:30 weekly by day with start time"
617 "Monday 1:30pm weekly by day with start time"
618 "DTSTART;VALUE=DATE-TIME:20000103T133000
619 DTEND;VALUE=DATE-TIME:20000103T143000
620 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
621 SUMMARY:weekly by day with start time
622 ")
623
624 (icalendar-tests--test-export
625 "Monday 13:30-15:00 weekly by day with start and end time"
626 "Montag 13:30-15:00 weekly by day with start and end time"
627 "Monday 01:30pm-03:00pm weekly by day with start and end time"
628 "DTSTART;VALUE=DATE-TIME:20000103T133000
629 DTEND;VALUE=DATE-TIME:20000103T150000
630 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
631 SUMMARY:weekly by day with start and end time
632 "))
633
634 (ert-deftest icalendar-export-yearly ()
635 "Perform export test."
636 ;; yearly
637 (icalendar-tests--test-export
638 "may 1 yearly no time"
639 "1 Mai yearly no time"
640 "may 1 yearly no time"
641 "DTSTART;VALUE=DATE:19000501
642 DTEND;VALUE=DATE:19000502
643 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
644 SUMMARY:yearly no time
645 "))
646
647 (ert-deftest icalendar-export-anniversary ()
648 "Perform export test."
649 ;; anniversaries
650 (icalendar-tests--test-export
651 "%%(diary-anniversary 1989 10 3) anniversary no time"
652 "%%(diary-anniversary 3 10 1989) anniversary no time"
653 "%%(diary-anniversary 10 3 1989) anniversary no time"
654 "DTSTART;VALUE=DATE:19891003
655 DTEND;VALUE=DATE:19891004
656 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
657 SUMMARY:anniversary no time
658 ")
659 (icalendar-tests--test-export
660 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
661 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
662 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
663 "DTSTART;VALUE=DATE-TIME:19891003T190000
664 DTEND;VALUE=DATE-TIME:19891004T200000
665 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
666 SUMMARY:anniversary with time
667 "))
668
669 (ert-deftest icalendar-export-block ()
670 "Perform export test."
671 ;; block
672 (icalendar-tests--test-export
673 "%%(diary-block 2001 6 18 2001 7 6) block no time"
674 "%%(diary-block 18 6 2001 6 7 2001) block no time"
675 "%%(diary-block 6 18 2001 7 6 2001) block no time"
676 "DTSTART;VALUE=DATE:20010618
677 DTEND;VALUE=DATE:20010707
678 SUMMARY:block no time
679 ")
680 (icalendar-tests--test-export
681 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
682 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
683 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
684 "DTSTART;VALUE=DATE-TIME:20010618T130000
685 DTEND;VALUE=DATE-TIME:20010618T170000
686 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
687 SUMMARY:block with time
688 ")
689 (icalendar-tests--test-export
690 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
691 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
692 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
693 "DTSTART;VALUE=DATE-TIME:20010618T130000
694 DTEND;VALUE=DATE-TIME:20010618T140000
695 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
696 SUMMARY:block no end time
697 "))
698
699 ;; ======================================================================
700 ;; Import tests
701 ;; ======================================================================
702
703 (defun icalendar-tests--test-import (input expected-iso expected-european
704 expected-american)
705 "Perform import test.
706 Argument INPUT icalendar event string.
707 Argument EXPECTED-ISO expected iso style diary string.
708 Argument EXPECTED-EUROPEAN expected european style diary string.
709 Argument EXPECTED-AMERICAN expected american style diary string."
710 (let ((timezone (getenv "TZ")))
711 (unwind-protect
712 (progn
713 ;;; (message "Current time zone: %s" (current-time-zone))
714 ;; Use this form so as not to rely on system tz database.
715 ;; Eg hydra.nixos.org.
716 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
717 ;;; (message "Current time zone: %s" (current-time-zone))
718 (with-temp-buffer
719 (if (string-match "^BEGIN:VCALENDAR" input)
720 (insert input)
721 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
722 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
723 (insert input)
724 (unless (eq (char-before) ?\n)
725 (insert "\n"))
726 (insert "END:VEVENT\nEND:VCALENDAR\n"))
727 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
728 (icalendar-import-format-summary "%s")
729 (icalendar-import-format-location "\n Location: %s")
730 (icalendar-import-format-description "\n Desc: %s")
731 (icalendar-import-format-organizer "\n Organizer: %s")
732 (icalendar-import-format-status "\n Status: %s")
733 (icalendar-import-format-url "\n URL: %s")
734 (icalendar-import-format-class "\n Class: %s")
735 (icalendar-import-format-uid "\n UID: %s")
736 calendar-date-style)
737 (when expected-iso
738 (setq calendar-date-style 'iso)
739 (icalendar-tests--do-test-import input expected-iso))
740 (when expected-european
741 (setq calendar-date-style 'european)
742 (icalendar-tests--do-test-import input expected-european))
743 (when expected-american
744 (setq calendar-date-style 'american)
745 (icalendar-tests--do-test-import input expected-american)))))
746 (setenv "TZ" timezone))))
747
748 (defun icalendar-tests--do-test-import (input expected-output)
749 "Actually perform import test.
750 Argument INPUT input icalendar string.
751 Argument EXPECTED-OUTPUT expected diary string."
752 (let ((temp-file (make-temp-file "icalendar-test-diary")))
753 ;; Test the Catch-the-mysterious-coding-header logic below.
754 ;; Ruby-mode adds an after-save-hook which inserts the header!
755 ;; (save-excursion
756 ;; (find-file temp-file)
757 ;; (ruby-mode))
758 (icalendar-import-buffer temp-file t t)
759 (save-excursion
760 (find-file temp-file)
761 ;; Check for the mysterious "# coding: ..." header, remove it
762 ;; and give a shout
763 (goto-char (point-min))
764 (when (re-search-forward "# coding: .*?\n" nil t)
765 (message (concat "%s\n"
766 "Found mysterious \"# coding ...\" header! Removing it.\n"
767 "Current Modes: %s, %s\n"
768 "Current test: %s\n"
769 "%s")
770 (make-string 70 ?*)
771 major-mode
772 minor-mode-list
773 (ert-running-test)
774 (make-string 70 ?*))
775 (buffer-disable-undo)
776 (replace-match "")
777 (set-buffer-modified-p nil))
778
779 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
780 (should (string= expected-output result)))
781 (kill-buffer (find-buffer-visiting temp-file))
782 (delete-file temp-file))))
783
784 (ert-deftest icalendar-import-non-recurring ()
785 "Perform standard import tests."
786 (icalendar-tests--test-import
787 "SUMMARY:non-recurring
788 DTSTART;VALUE=DATE-TIME:20030919T090000
789 DTEND;VALUE=DATE-TIME:20030919T113000"
790 "&2003/9/19 09:00-11:30 non-recurring\n"
791 "&19/9/2003 09:00-11:30 non-recurring\n"
792 "&9/19/2003 09:00-11:30 non-recurring\n")
793 (icalendar-tests--test-import
794 "SUMMARY:non-recurring allday
795 DTSTART;VALUE=DATE-TIME:20030919"
796 "&2003/9/19 non-recurring allday\n"
797 "&19/9/2003 non-recurring allday\n"
798 "&9/19/2003 non-recurring allday\n")
799 (icalendar-tests--test-import
800 ;; Checkdoc removes trailing blanks. Therefore: format!
801 (format "%s\n%s\n%s" "SUMMARY:long " " summary"
802 "DTSTART;VALUE=DATE:20030919")
803 "&2003/9/19 long summary\n"
804 "&19/9/2003 long summary\n"
805 "&9/19/2003 long summary\n")
806 (icalendar-tests--test-import
807 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
808 SUMMARY:Sommerferien
809 STATUS:TENTATIVE
810 CLASS:PRIVATE
811 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
812 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
813 DTSTART;VALUE=DATE:20040719
814 DTEND;VALUE=DATE:20040828
815 DTSTAMP:20031103T011641Z
816 "
817 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien
818 Status: TENTATIVE
819 Class: PRIVATE
820 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
821 "
822 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien
823 Status: TENTATIVE
824 Class: PRIVATE
825 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
826 "
827 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien
828 Status: TENTATIVE
829 Class: PRIVATE
830 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
831 ")
832 (icalendar-tests--test-import
833 "UID
834 :04979712-3902-11d9-93dd-8f9f4afe08da
835 SUMMARY
836 :folded summary
837 STATUS
838 :TENTATIVE
839 CLASS
840 :PRIVATE
841 X-MOZILLA-ALARM-DEFAULT-LENGTH
842 :0
843 DTSTART
844 :20041123T140000
845 DTEND
846 :20041123T143000
847 DTSTAMP
848 :20041118T013430Z
849 LAST-MODIFIED
850 :20041118T013640Z
851 "
852 "&2004/11/23 14:00-14:30 folded summary
853 Status: TENTATIVE
854 Class: PRIVATE
855 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
856 "&23/11/2004 14:00-14:30 folded summary
857 Status: TENTATIVE
858 Class: PRIVATE
859 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
860 "&11/23/2004 14:00-14:30 folded summary
861 Status: TENTATIVE
862 Class: PRIVATE
863 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n")
864
865 (icalendar-tests--test-import
866 "UID
867 :6161a312-3902-11d9-b512-f764153bb28b
868 SUMMARY
869 :another example
870 STATUS
871 :TENTATIVE
872 CLASS
873 :PRIVATE
874 X-MOZILLA-ALARM-DEFAULT-LENGTH
875 :0
876 DTSTART
877 :20041123T144500
878 DTEND
879 :20041123T154500
880 DTSTAMP
881 :20041118T013641Z
882 "
883 "&2004/11/23 14:45-15:45 another example
884 Status: TENTATIVE
885 Class: PRIVATE
886 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
887 "&23/11/2004 14:45-15:45 another example
888 Status: TENTATIVE
889 Class: PRIVATE
890 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
891 "&11/23/2004 14:45-15:45 another example
892 Status: TENTATIVE
893 Class: PRIVATE
894 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"))
895
896 (ert-deftest icalendar-import-rrule ()
897 (icalendar-tests--test-import
898 "SUMMARY:rrule daily
899 DTSTART;VALUE=DATE-TIME:20030919T090000
900 DTEND;VALUE=DATE-TIME:20030919T113000
901 RRULE:FREQ=DAILY;
902 "
903 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily\n"
904 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily\n"
905 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily\n")
906 ;; RRULE examples
907 (icalendar-tests--test-import
908 "SUMMARY:rrule daily
909 DTSTART;VALUE=DATE-TIME:20030919T090000
910 DTEND;VALUE=DATE-TIME:20030919T113000
911 RRULE:FREQ=DAILY;INTERVAL=2
912 "
913 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily\n"
914 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily\n"
915 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily\n")
916 (icalendar-tests--test-import
917 "SUMMARY:rrule daily with exceptions
918 DTSTART;VALUE=DATE-TIME:20030919T090000
919 DTEND;VALUE=DATE-TIME:20030919T113000
920 RRULE:FREQ=DAILY;INTERVAL=2
921 EXDATE:20030921,20030925
922 "
923 "&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions\n"
924 "&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions\n"
925 "&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions\n")
926 (icalendar-tests--test-import
927 "SUMMARY:rrule weekly
928 DTSTART;VALUE=DATE-TIME:20030919T090000
929 DTEND;VALUE=DATE-TIME:20030919T113000
930 RRULE:FREQ=WEEKLY;
931 "
932 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly\n"
933 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly\n"
934 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly\n")
935 (icalendar-tests--test-import
936 "SUMMARY:rrule monthly no end
937 DTSTART;VALUE=DATE-TIME:20030919T090000
938 DTEND;VALUE=DATE-TIME:20030919T113000
939 RRULE:FREQ=MONTHLY;
940 "
941 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end\n"
942 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n"
943 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n")
944 (icalendar-tests--test-import
945 "SUMMARY:rrule monthly with end
946 DTSTART;VALUE=DATE-TIME:20030919T090000
947 DTEND;VALUE=DATE-TIME:20030919T113000
948 RRULE:FREQ=MONTHLY;UNTIL=20050819;
949 "
950 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end\n"
951 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end\n"
952 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end\n")
953 (icalendar-tests--test-import
954 "DTSTART;VALUE=DATE:20040815
955 DTEND;VALUE=DATE:20040816
956 SUMMARY:Maria Himmelfahrt
957 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
958 "
959 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt\n"
960 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt\n"
961 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt\n")
962 (icalendar-tests--test-import
963 "SUMMARY:rrule yearly
964 DTSTART;VALUE=DATE-TIME:20030919T090000
965 DTEND;VALUE=DATE-TIME:20030919T113000
966 RRULE:FREQ=YEARLY;INTERVAL=2
967 "
968 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly\n" ;FIXME
969 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly\n" ;FIXME
970 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly\n") ;FIXME
971 (icalendar-tests--test-import
972 "SUMMARY:rrule count daily short
973 DTSTART;VALUE=DATE-TIME:20030919T090000
974 DTEND;VALUE=DATE-TIME:20030919T113000
975 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
976 "
977 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short\n"
978 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short\n"
979 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short\n")
980 (icalendar-tests--test-import
981 "SUMMARY:rrule count daily long
982 DTSTART;VALUE=DATE-TIME:20030919T090000
983 DTEND;VALUE=DATE-TIME:20030919T113000
984 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
985 "
986 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long\n"
987 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long\n"
988 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long\n")
989 (icalendar-tests--test-import
990 "SUMMARY:rrule count bi-weekly 3 times
991 DTSTART;VALUE=DATE-TIME:20030919T090000
992 DTEND;VALUE=DATE-TIME:20030919T113000
993 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
994 "
995 "&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times\n"
996 "&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n"
997 "&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n")
998 (icalendar-tests--test-import
999 "SUMMARY:rrule count monthly
1000 DTSTART;VALUE=DATE-TIME:20030919T090000
1001 DTEND;VALUE=DATE-TIME:20030919T113000
1002 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
1003 "
1004 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly\n"
1005 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly\n"
1006 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly\n")
1007 (icalendar-tests--test-import
1008 "SUMMARY:rrule count every second month
1009 DTSTART;VALUE=DATE-TIME:20030919T090000
1010 DTEND;VALUE=DATE-TIME:20030919T113000
1011 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
1012 "
1013 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month\n" ;FIXME
1014 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month\n" ;FIXME
1015 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month\n") ;FIXME
1016 (icalendar-tests--test-import
1017 "SUMMARY:rrule count yearly
1018 DTSTART;VALUE=DATE-TIME:20030919T090000
1019 DTEND;VALUE=DATE-TIME:20030919T113000
1020 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
1021 "
1022 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly\n"
1023 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly\n"
1024 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly\n")
1025 (icalendar-tests--test-import
1026 "SUMMARY:rrule count every second year
1027 DTSTART;VALUE=DATE-TIME:20030919T090000
1028 DTEND;VALUE=DATE-TIME:20030919T113000
1029 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
1030 "
1031 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year\n" ;FIXME!!!
1032 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year\n" ;FIXME!!!
1033 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year\n") ;FIXME!!!
1034 )
1035
1036 (ert-deftest icalendar-import-duration ()
1037 ;; duration
1038 (icalendar-tests--test-import
1039 "DTSTART;VALUE=DATE:20050217
1040 SUMMARY:duration
1041 DURATION:P7D
1042 "
1043 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration\n"
1044 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration\n"
1045 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration\n")
1046 (icalendar-tests--test-import
1047 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
1048 DTSTAMP:20041127T183315Z
1049 LAST-MODIFIED:20041127T183329
1050 SUMMARY:Urlaub
1051 DTSTART;VALUE=DATE:20011221
1052 DTEND;VALUE=DATE:20011221
1053 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
1054 CLASS:PUBLIC
1055 SEQUENCE:1
1056 CREATED:20041127T183329
1057 "
1058 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub
1059 Class: PUBLIC
1060 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1061 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub
1062 Class: PUBLIC
1063 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1064 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub
1065 Class: PUBLIC
1066 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"))
1067
1068 (ert-deftest icalendar-import-bug-6766 ()
1069 ;;bug#6766 -- multiple byday values in a weekly rrule
1070 (icalendar-tests--test-import
1071 "CLASS:PUBLIC
1072 DTEND;TZID=America/New_York:20100421T120000
1073 DTSTAMP:20100525T141214Z
1074 DTSTART;TZID=America/New_York:20100421T113000
1075 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR
1076 SEQUENCE:1
1077 STATUS:CONFIRMED
1078 SUMMARY:Scrum
1079 TRANSP:OPAQUE
1080 UID:8814e3f9-7482-408f-996c-3bfe486a1262
1081 END:VEVENT
1082 BEGIN:VEVENT
1083 CLASS:PUBLIC
1084 DTSTAMP:20100525T141214Z
1085 DTSTART;VALUE=DATE:20100422
1086 DTEND;VALUE=DATE:20100423
1087 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH
1088 SEQUENCE:1
1089 SUMMARY:Tues + Thurs thinking
1090 TRANSP:OPAQUE
1091 UID:8814e3f9-7482-408f-996c-3bfe486a1263
1092 "
1093 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum
1094 Status: CONFIRMED
1095 Class: PUBLIC
1096 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1097 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking
1098 Class: PUBLIC
1099 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1100 "
1101 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum
1102 Status: CONFIRMED
1103 Class: PUBLIC
1104 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1105 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking
1106 Class: PUBLIC
1107 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1108 "
1109 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum
1110 Status: CONFIRMED
1111 Class: PUBLIC
1112 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1113 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking
1114 Class: PUBLIC
1115 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1116 "))
1117
1118 (ert-deftest icalendar-import-multiple-vcalendars ()
1119 (icalendar-tests--test-import
1120 "DTSTART;VALUE=DATE:20110723
1121 SUMMARY:event-1
1122 "
1123 "&2011/7/23 event-1\n"
1124 "&23/7/2011 event-1\n"
1125 "&7/23/2011 event-1\n")
1126
1127 (icalendar-tests--test-import
1128 "BEGIN:VCALENDAR
1129 PRODID:-//Emacs//NONSGML icalendar.el//EN
1130 VERSION:2.0\nBEGIN:VEVENT
1131 DTSTART;VALUE=DATE:20110723
1132 SUMMARY:event-1
1133 END:VEVENT
1134 END:VCALENDAR
1135 BEGIN:VCALENDAR
1136 PRODID:-//Emacs//NONSGML icalendar.el//EN
1137 VERSION:2.0
1138 BEGIN:VEVENT
1139 DTSTART;VALUE=DATE:20110724
1140 SUMMARY:event-2
1141 END:VEVENT
1142 END:VCALENDAR
1143 BEGIN:VCALENDAR
1144 PRODID:-//Emacs//NONSGML icalendar.el//EN
1145 VERSION:2.0
1146 BEGIN:VEVENT
1147 DTSTART;VALUE=DATE:20110725
1148 SUMMARY:event-3a
1149 END:VEVENT
1150 BEGIN:VEVENT
1151 DTSTART;VALUE=DATE:20110725
1152 SUMMARY:event-3b
1153 END:VEVENT
1154 END:VCALENDAR
1155 "
1156 "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n"
1157 "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n"
1158 "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n"))
1159
1160 (ert-deftest icalendar-import-with-uid ()
1161 "Perform import test with uid."
1162 (icalendar-tests--test-import
1163 "UID:1234567890uid
1164 SUMMARY:non-recurring
1165 DTSTART;VALUE=DATE-TIME:20030919T090000
1166 DTEND;VALUE=DATE-TIME:20030919T113000"
1167 "&2003/9/19 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1168 "&19/9/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1169 "&9/19/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"))
1170
1171 (ert-deftest icalendar-import-with-timezone ()
1172 ;; bug#11473
1173 (icalendar-tests--test-import
1174 "BEGIN:VCALENDAR
1175 BEGIN:VTIMEZONE
1176 TZID:fictional\, nonexistent\, arbitrary
1177 BEGIN:STANDARD
1178 DTSTART:20100101T000000
1179 TZOFFSETFROM:+0200
1180 TZOFFSETTO:-0200
1181 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01
1182 END:STANDARD
1183 BEGIN:DAYLIGHT
1184 DTSTART:20101201T000000
1185 TZOFFSETFROM:-0200
1186 TZOFFSETTO:+0200
1187 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
1188 END:DAYLIGHT
1189 END:VTIMEZONE
1190 BEGIN:VEVENT
1191 SUMMARY:standardtime
1192 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000
1193 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000
1194 END:VEVENT
1195 BEGIN:VEVENT
1196 SUMMARY:daylightsavingtime
1197 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000
1198 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000
1199 END:VEVENT
1200 END:VCALENDAR"
1201 ;; "standardtime" begins first sunday in january and is 4 hours behind CET
1202 ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET
1203 "&2012/1/15 15:00-15:30 standardtime
1204 &2012/12/15 11:00-11:30 daylightsavingtime
1205 "
1206 nil
1207 nil)
1208 )
1209 ;; ======================================================================
1210 ;; Cycle
1211 ;; ======================================================================
1212 (defun icalendar-tests--test-cycle (input)
1213 "Perform cycle test.
1214 Argument INPUT icalendar event string."
1215 (with-temp-buffer
1216 (if (string-match "^BEGIN:VCALENDAR" input)
1217 (insert input)
1218 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1219 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1220 (insert input)
1221 (unless (eq (char-before) ?\n)
1222 (insert "\n"))
1223 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1224 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
1225 (icalendar-import-format-summary "%s")
1226 (icalendar-import-format-location "\n Location: %s")
1227 (icalendar-import-format-description "\n Desc: %s")
1228 (icalendar-import-format-organizer "\n Organizer: %s")
1229 (icalendar-import-format-status "\n Status: %s")
1230 (icalendar-import-format-url "\n URL: %s")
1231 (icalendar-import-format-class "\n Class: %s")
1232 (icalendar-import-format-class "\n UID: %s"))
1233 (dolist (calendar-date-style '(iso european american))
1234 (icalendar-tests--do-test-cycle)))))
1235
1236 (defun icalendar-tests--do-test-cycle ()
1237 "Actually perform import/export cycle test."
1238 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1239 (temp-ics (make-temp-file "icalendar-test-ics"))
1240 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1241
1242 (unwind-protect
1243 (progn
1244 ;; step 1: import
1245 (icalendar-import-buffer temp-diary t t)
1246
1247 ;; step 2: export what was just imported
1248 (save-excursion
1249 (find-file temp-diary)
1250 (icalendar-export-region (point-min) (point-max) temp-ics))
1251
1252 ;; compare the output of step 2 with the input of step 1
1253 (save-excursion
1254 (find-file temp-ics)
1255 (goto-char (point-min))
1256 ;;(when (re-search-forward "\nUID:.*\n" nil t)
1257 ;;(replace-match "\n"))
1258 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1259 (should (string= org-input cycled)))))
1260 ;; clean up
1261 (kill-buffer (find-buffer-visiting temp-diary))
1262 (with-current-buffer (find-buffer-visiting temp-ics)
1263 (set-buffer-modified-p nil)
1264 (kill-buffer (current-buffer)))
1265 (delete-file temp-diary)
1266 (delete-file temp-ics))))
1267
1268 (ert-deftest icalendar-cycle ()
1269 "Perform cycling tests.
1270 Take care to avoid auto-generated UIDs here."
1271 (icalendar-tests--test-cycle
1272 "UID:dummyuid
1273 DTSTART;VALUE=DATE-TIME:20030919T090000
1274 DTEND;VALUE=DATE-TIME:20030919T113000
1275 SUMMARY:Cycletest
1276 ")
1277 (icalendar-tests--test-cycle
1278 "UID:blah
1279 DTSTART;VALUE=DATE-TIME:20030919T090000
1280 DTEND;VALUE=DATE-TIME:20030919T113000
1281 SUMMARY:Cycletest
1282 DESCRIPTION:beschreibung!
1283 LOCATION:nowhere
1284 ORGANIZER:ulf
1285 ")
1286 (icalendar-tests--test-cycle
1287 "UID:4711
1288 DTSTART;VALUE=DATE:19190909
1289 DTEND;VALUE=DATE:19190910
1290 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1291 SUMMARY:and diary-anniversary
1292 "))
1293
1294 ;; ======================================================================
1295 ;; Real world
1296 ;; ======================================================================
1297 (ert-deftest icalendar-real-world ()
1298 "Perform real-world tests, as gathered from problem reports."
1299 ;; 2003-05-29
1300 (icalendar-tests--test-import
1301 "BEGIN:VCALENDAR
1302 METHOD:REQUEST
1303 PRODID:Microsoft CDO for Microsoft Exchange
1304 VERSION:2.0
1305 BEGIN:VTIMEZONE
1306 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
1307 X-MICROSOFT-CDO-TZID:23
1308 BEGIN:STANDARD
1309 DTSTART:16010101T000000
1310 TZOFFSETFROM:+0530
1311 TZOFFSETTO:+0530
1312 END:STANDARD
1313 BEGIN:DAYLIGHT
1314 DTSTART:16010101T000000
1315 TZOFFSETFROM:+0530
1316 TZOFFSETTO:+0530
1317 END:DAYLIGHT
1318 END:VTIMEZONE
1319 BEGIN:VEVENT
1320 DTSTAMP:20030509T043439Z
1321 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1322 SUMMARY:On-Site Interview
1323 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1324 010000000DB823520692542408ED02D7023F9DFF9
1325 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1326 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1327 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1328 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1329 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1330 zz\":MAILTO:zzzzzz@zzzzzzz.com
1331 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1332 LOCATION:Cccc
1333 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1334 DESCRIPTION:10:30am - Blah
1335 SEQUENCE:0
1336 PRIORITY:5
1337 CLASS:
1338 CREATED:20030509T043439Z
1339 LAST-MODIFIED:20030509T043459Z
1340 STATUS:CONFIRMED
1341 TRANSP:OPAQUE
1342 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1343 X-MICROSOFT-CDO-INSTTYPE:0
1344 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1345 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1346 X-MICROSOFT-CDO-IMPORTANCE:1
1347 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1348 BEGIN:VALARM
1349 ACTION:DISPLAY
1350 DESCRIPTION:REMINDER
1351 TRIGGER;RELATED=START:-PT00H15M00S
1352 END:VALARM
1353 END:VEVENT
1354 END:VCALENDAR"
1355 nil
1356 "&9/5/2003 10:30-15:30 On-Site Interview
1357 Desc: 10:30am - Blah
1358 Location: Cccc
1359 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1360 Status: CONFIRMED
1361 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1362 "
1363 "&5/9/2003 10:30-15:30 On-Site Interview
1364 Desc: 10:30am - Blah
1365 Location: Cccc
1366 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1367 Status: CONFIRMED
1368 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1369 ")
1370
1371 ;; 2003-06-18 a
1372 (icalendar-tests--test-import
1373 "DTSTAMP:20030618T195512Z
1374 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1375 SUMMARY:Dress Rehearsal for XXXX-XXXX
1376 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1377 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1378 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1379 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1380 ORGANIZER;CN=\"ABCD,TECHTRAINING
1381 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1382 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1383 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1384 DESCRIPTION:753 Zeichen hier radiert
1385 SEQUENCE:0
1386 PRIORITY:5
1387 CLASS:
1388 CREATED:20030618T195518Z
1389 LAST-MODIFIED:20030618T195527Z
1390 STATUS:CONFIRMED
1391 TRANSP:OPAQUE
1392 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1393 X-MICROSOFT-CDO-INSTTYPE:0
1394 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1395 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1396 X-MICROSOFT-CDO-IMPORTANCE:1
1397 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1398 BEGIN:VALARM
1399 ACTION:DISPLAY
1400 DESCRIPTION:REMINDER
1401 TRIGGER;RELATED=START:-PT00H15M00S
1402 END:VALARM"
1403 nil
1404 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1405 Desc: 753 Zeichen hier radiert
1406 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1407 Organizer: MAILTO:xxx@xxxxx.com
1408 Status: CONFIRMED
1409 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1410 "
1411 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1412 Desc: 753 Zeichen hier radiert
1413 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1414 Organizer: MAILTO:xxx@xxxxx.com
1415 Status: CONFIRMED
1416 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1417 ")
1418 ;; 2003-06-18 b -- uses timezone
1419 (icalendar-tests--test-import
1420 "BEGIN:VCALENDAR
1421 METHOD:REQUEST
1422 PRODID:Microsoft CDO for Microsoft Exchange
1423 VERSION:2.0
1424 BEGIN:VTIMEZONE
1425 TZID:Mountain Time (US & Canada)
1426 X-MICROSOFT-CDO-TZID:12
1427 BEGIN:STANDARD
1428 DTSTART:16010101T020000
1429 TZOFFSETFROM:-0600
1430 TZOFFSETTO:-0700
1431 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1432 END:STANDARD
1433 BEGIN:DAYLIGHT
1434 DTSTART:16010101T020000
1435 TZOFFSETFROM:-0700
1436 TZOFFSETTO:-0600
1437 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1438 END:DAYLIGHT
1439 END:VTIMEZONE
1440 BEGIN:VEVENT
1441 DTSTAMP:20030618T230323Z
1442 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1443 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1444 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1445 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1446 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1447 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1448 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1449 .com
1450 ORGANIZER;CN=\"ABCD,TECHTRAINING
1451 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1452 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1453 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1454 DESCRIPTION:Viele Zeichen standen hier früher
1455 SEQUENCE:0
1456 PRIORITY:5
1457 CLASS:
1458 CREATED:20030618T230326Z
1459 LAST-MODIFIED:20030618T230335Z
1460 STATUS:CONFIRMED
1461 TRANSP:OPAQUE
1462 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1463 X-MICROSOFT-CDO-INSTTYPE:0
1464 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1465 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1466 X-MICROSOFT-CDO-IMPORTANCE:1
1467 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1468 BEGIN:VALARM
1469 ACTION:DISPLAY
1470 DESCRIPTION:REMINDER
1471 TRIGGER;RELATED=START:-PT00H15M00S
1472 END:VALARM
1473 END:VEVENT
1474 END:VCALENDAR"
1475 nil
1476 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1477 Desc: Viele Zeichen standen hier früher
1478 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1479 Organizer: MAILTO:bbb@bbbbb.com
1480 Status: CONFIRMED
1481 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1482 "
1483 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1484 Desc: Viele Zeichen standen hier früher
1485 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1486 Organizer: MAILTO:bbb@bbbbb.com
1487 Status: CONFIRMED
1488 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1489 ")
1490 ;; export 2004-10-28 block entries
1491 (icalendar-tests--test-export
1492 nil
1493 nil
1494 "-*- mode: text; fill-column: 256;-*-
1495
1496 >>> block entries:
1497
1498 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1499 "
1500 "DTSTART;VALUE=DATE:20041108
1501 DTEND;VALUE=DATE:20041111
1502 SUMMARY:Nov 8-10 aa")
1503
1504 (icalendar-tests--test-export
1505 nil
1506 nil
1507 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1508 "DTSTART;VALUE=DATE:20041213
1509 DTEND;VALUE=DATE:20041218
1510 SUMMARY:Dec 13-17 bb")
1511
1512 (icalendar-tests--test-export
1513 nil
1514 nil
1515 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1516 "DTSTART;VALUE=DATE:20050203
1517 DTEND;VALUE=DATE:20050205
1518 SUMMARY:Feb 3-4 cc")
1519
1520 (icalendar-tests--test-export
1521 nil
1522 nil
1523 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1524 "DTSTART;VALUE=DATE:20050424
1525 DTEND;VALUE=DATE:20050430
1526 SUMMARY:April 24-29 dd
1527 ")
1528 (icalendar-tests--test-export
1529 nil
1530 nil
1531 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1532 "DTSTART;VALUE=DATE:20050530
1533 DTEND;VALUE=DATE:20050602
1534 SUMMARY:may 30 - June 1: ee")
1535
1536 (icalendar-tests--test-export
1537 nil
1538 nil
1539 "%%(diary-block 6 6 2005 6 8 2005) ff"
1540 "DTSTART;VALUE=DATE:20050606
1541 DTEND;VALUE=DATE:20050609
1542 SUMMARY:ff")
1543
1544 ;; export 2004-10-28 anniversary entries
1545 (icalendar-tests--test-export
1546 nil
1547 nil
1548 "
1549 >>> anniversaries:
1550
1551 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1552 "DTSTART;VALUE=DATE:19910328
1553 DTEND;VALUE=DATE:19910329
1554 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1555 SUMMARY:aa birthday (%d years old)
1556 ")
1557
1558 (icalendar-tests--test-export
1559 nil
1560 nil
1561 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1562 "DTSTART;VALUE=DATE:19570517
1563 DTEND;VALUE=DATE:19570518
1564 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1565 SUMMARY:bb birthday (%d years old)")
1566
1567 (icalendar-tests--test-export
1568 nil
1569 nil
1570 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1571 "DTSTART;VALUE=DATE:19970608
1572 DTEND;VALUE=DATE:19970609
1573 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1574 SUMMARY:cc birthday (%d years old)")
1575
1576 (icalendar-tests--test-export
1577 nil
1578 nil
1579 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1580 "DTSTART;VALUE=DATE:19830722
1581 DTEND;VALUE=DATE:19830723
1582 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1583 SUMMARY:dd (%d years ago...!)")
1584
1585 (icalendar-tests--test-export
1586 nil
1587 nil
1588 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1589 "DTSTART;VALUE=DATE:19880801
1590 DTEND;VALUE=DATE:19880802
1591 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1592 SUMMARY:ee birthday (%d years old)")
1593
1594 (icalendar-tests--test-export
1595 nil
1596 nil
1597 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1598 "DTSTART;VALUE=DATE:19570921
1599 DTEND;VALUE=DATE:19570922
1600 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1601 SUMMARY:ff birthday (%d years old)")
1602
1603
1604 ;; FIXME!
1605
1606 ;; export 2004-10-28 monthly, weekly entries
1607
1608 ;; (icalendar-tests--test-export
1609 ;; nil
1610 ;; "
1611 ;; >>> ------------ monthly:
1612
1613 ;; */27/* 10:00 blah blah"
1614 ;; "xxx")
1615
1616 (icalendar-tests--test-export
1617 nil
1618 nil
1619 ">>> ------------ my week:
1620
1621 Monday 13:00 MAC"
1622 "DTSTART;VALUE=DATE-TIME:20000103T130000
1623 DTEND;VALUE=DATE-TIME:20000103T140000
1624 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1625 SUMMARY:MAC")
1626
1627 (icalendar-tests--test-export
1628 nil
1629 nil
1630 "Monday 15:00 a1"
1631 "DTSTART;VALUE=DATE-TIME:20000103T150000
1632 DTEND;VALUE=DATE-TIME:20000103T160000
1633 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1634 SUMMARY:a1")
1635
1636
1637 (icalendar-tests--test-export
1638 nil
1639 nil
1640 "Monday 16:00-17:00 a2"
1641 "DTSTART;VALUE=DATE-TIME:20000103T160000
1642 DTEND;VALUE=DATE-TIME:20000103T170000
1643 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1644 SUMMARY:a2")
1645
1646 (icalendar-tests--test-export
1647 nil
1648 nil
1649 "Tuesday 11:30-13:00 a3"
1650 "DTSTART;VALUE=DATE-TIME:20000104T113000
1651 DTEND;VALUE=DATE-TIME:20000104T130000
1652 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1653 SUMMARY:a3")
1654
1655 (icalendar-tests--test-export
1656 nil
1657 nil
1658 "Tuesday 15:00 a4"
1659 "DTSTART;VALUE=DATE-TIME:20000104T150000
1660 DTEND;VALUE=DATE-TIME:20000104T160000
1661 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1662 SUMMARY:a4")
1663
1664 (icalendar-tests--test-export
1665 nil
1666 nil
1667 "Wednesday 13:00 a5"
1668 "DTSTART;VALUE=DATE-TIME:20000105T130000
1669 DTEND;VALUE=DATE-TIME:20000105T140000
1670 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1671 SUMMARY:a5")
1672
1673 (icalendar-tests--test-export
1674 nil
1675 nil
1676 "Wednesday 11:30-13:30 a6"
1677 "DTSTART;VALUE=DATE-TIME:20000105T113000
1678 DTEND;VALUE=DATE-TIME:20000105T133000
1679 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1680 SUMMARY:a6")
1681
1682 (icalendar-tests--test-export
1683 nil
1684 nil
1685 "Wednesday 15:00 s1"
1686 "DTSTART;VALUE=DATE-TIME:20000105T150000
1687 DTEND;VALUE=DATE-TIME:20000105T160000
1688 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1689 SUMMARY:s1")
1690
1691
1692 ;; export 2004-10-28 regular entries
1693 (icalendar-tests--test-export
1694 nil
1695 nil
1696 "
1697 >>> regular diary entries:
1698
1699 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1700 "DTSTART;VALUE=DATE-TIME:20041012T140000
1701 DTEND;VALUE=DATE-TIME:20041012T150000
1702 SUMMARY:Tue: [2004-10-12] q1")
1703
1704 ;; 2004-11-19
1705 (icalendar-tests--test-import
1706 "BEGIN:VCALENDAR
1707 VERSION
1708 :2.0
1709 PRODID
1710 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1711 BEGIN:VEVENT
1712 SUMMARY
1713 :Jjjjj & Wwwww
1714 STATUS
1715 :TENTATIVE
1716 CLASS
1717 :PRIVATE
1718 X-MOZILLA-ALARM-DEFAULT-LENGTH
1719 :0
1720 DTSTART
1721 :20041123T140000
1722 DTEND
1723 :20041123T143000
1724 DTSTAMP
1725 :20041118T013430Z
1726 LAST-MODIFIED
1727 :20041118T013640Z
1728 END:VEVENT
1729 BEGIN:VEVENT
1730 SUMMARY
1731 :BB Aaaaaaaa Bbbbb
1732 STATUS
1733 :TENTATIVE
1734 CLASS
1735 :PRIVATE
1736 X-MOZILLA-ALARM-DEFAULT-LENGTH
1737 :0
1738 DTSTART
1739 :20041123T144500
1740 DTEND
1741 :20041123T154500
1742 DTSTAMP
1743 :20041118T013641Z
1744 END:VEVENT
1745 BEGIN:VEVENT
1746 SUMMARY
1747 :Hhhhhhhh
1748 STATUS
1749 :TENTATIVE
1750 CLASS
1751 :PRIVATE
1752 X-MOZILLA-ALARM-DEFAULT-LENGTH
1753 :0
1754 DTSTART
1755 :20041123T110000
1756 DTEND
1757 :20041123T120000
1758 DTSTAMP
1759 :20041118T013831Z
1760 END:VEVENT
1761 BEGIN:VEVENT
1762 SUMMARY
1763 :MMM Aaaaaaaaa
1764 STATUS
1765 :TENTATIVE
1766 CLASS
1767 :PRIVATE
1768 X-MOZILLA-ALARM-DEFAULT-LENGTH
1769 :0
1770 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1771 :2
1772 RRULE
1773 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1774 DTSTART
1775 :20041112T140000
1776 DTEND
1777 :20041112T183000
1778 DTSTAMP
1779 :20041118T014117Z
1780 END:VEVENT
1781 BEGIN:VEVENT
1782 SUMMARY
1783 :Rrrr/Cccccc ii Aaaaaaaa
1784 DESCRIPTION
1785 :Vvvvv Rrrr aaa Cccccc
1786 STATUS
1787 :TENTATIVE
1788 CLASS
1789 :PRIVATE
1790 X-MOZILLA-ALARM-DEFAULT-LENGTH
1791 :0
1792 DTSTART
1793 ;VALUE=DATE
1794 :20041119
1795 DTEND
1796 ;VALUE=DATE
1797 :20041120
1798 DTSTAMP
1799 :20041118T013107Z
1800 LAST-MODIFIED
1801 :20041118T014203Z
1802 END:VEVENT
1803 BEGIN:VEVENT
1804 SUMMARY
1805 :Wwww aa hhhh
1806 STATUS
1807 :TENTATIVE
1808 CLASS
1809 :PRIVATE
1810 X-MOZILLA-ALARM-DEFAULT-LENGTH
1811 :0
1812 RRULE
1813 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1814 DTSTART
1815 ;VALUE=DATE
1816 :20041101
1817 DTEND
1818 ;VALUE=DATE
1819 :20041102
1820 DTSTAMP
1821 :20041118T014045Z
1822 LAST-MODIFIED
1823 :20041118T023846Z
1824 END:VEVENT
1825 END:VCALENDAR
1826 "
1827 nil
1828 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1829 Status: TENTATIVE
1830 Class: PRIVATE
1831 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1832 Status: TENTATIVE
1833 Class: PRIVATE
1834 &23/11/2004 11:00-12:00 Hhhhhhhh
1835 Status: TENTATIVE
1836 Class: PRIVATE
1837 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1838 Status: TENTATIVE
1839 Class: PRIVATE
1840 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1841 Desc: Vvvvv Rrrr aaa Cccccc
1842 Status: TENTATIVE
1843 Class: PRIVATE
1844 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1845 Status: TENTATIVE
1846 Class: PRIVATE
1847 "
1848 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1849 Status: TENTATIVE
1850 Class: PRIVATE
1851 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1852 Status: TENTATIVE
1853 Class: PRIVATE
1854 &11/23/2004 11:00-12:00 Hhhhhhhh
1855 Status: TENTATIVE
1856 Class: PRIVATE
1857 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1858 Status: TENTATIVE
1859 Class: PRIVATE
1860 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1861 Desc: Vvvvv Rrrr aaa Cccccc
1862 Status: TENTATIVE
1863 Class: PRIVATE
1864 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1865 Status: TENTATIVE
1866 Class: PRIVATE
1867 ")
1868
1869 ;; 2004-09-09 pg
1870 (icalendar-tests--test-export
1871 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1872 nil
1873 nil
1874 "DTSTART;VALUE=DATE:20040101
1875 DTEND;VALUE=DATE:20040105
1876 SUMMARY:Urlaub")
1877
1878 ;; 2004-10-25 pg
1879 (icalendar-tests--test-export
1880 nil
1881 "5 11 2004 Bla Fasel"
1882 nil
1883 "DTSTART;VALUE=DATE:20041105
1884 DTEND;VALUE=DATE:20041106
1885 SUMMARY:Bla Fasel")
1886
1887 ;; 2004-10-30 pg
1888 (icalendar-tests--test-export
1889 nil
1890 "2 Nov 2004 15:00-16:30 Zahnarzt"
1891 nil
1892 "DTSTART;VALUE=DATE-TIME:20041102T150000
1893 DTEND;VALUE=DATE-TIME:20041102T163000
1894 SUMMARY:Zahnarzt")
1895
1896 ;; 2005-02-07 lt
1897 (icalendar-tests--test-import
1898 "UID
1899 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1900 SUMMARY
1901 :Waitangi Day
1902 DESCRIPTION
1903 :abcdef
1904 CATEGORIES
1905 :Public Holiday
1906 STATUS
1907 :CONFIRMED
1908 CLASS
1909 :PRIVATE
1910 DTSTART
1911 ;VALUE=DATE
1912 :20050206
1913 DTEND
1914 ;VALUE=DATE
1915 :20050207
1916 DTSTAMP
1917 :20050128T011209Z"
1918 nil
1919 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1920 Desc: abcdef
1921 Status: CONFIRMED
1922 Class: PRIVATE
1923 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
1924 "
1925 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1926 Desc: abcdef
1927 Status: CONFIRMED
1928 Class: PRIVATE
1929 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
1930 ")
1931
1932 ;; 2005-03-01 lt
1933 (icalendar-tests--test-import
1934 "DTSTART;VALUE=DATE:20050217
1935 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1936 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1937 DTSTAMP:20050118T210335Z
1938 DURATION:P7D"
1939 nil
1940 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
1941 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n"
1942 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
1943 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n")
1944
1945 ;; 2005-03-23 lt
1946 (icalendar-tests--test-export
1947 nil
1948 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1949 nil
1950 "DTSTART;VALUE=DATE-TIME:20050208T160000
1951 DTEND;VALUE=DATE-TIME:20050208T164500
1952 RRULE:FREQ=DAILY;INTERVAL=7
1953 SUMMARY:[WORK] Pppp
1954 ")
1955
1956 ;; 2005-05-27 eu
1957 (icalendar-tests--test-export
1958 nil
1959 nil
1960 ;; FIXME: colon not allowed!
1961 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1962 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1963 "DTSTART;VALUE=DATE:19001101
1964 DTEND;VALUE=DATE:19001102
1965 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1966 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1967 ")
1968
1969 ;; bug#11473
1970 (icalendar-tests--test-import
1971 "BEGIN:VCALENDAR
1972 METHOD:REQUEST
1973 PRODID:Microsoft Exchange Server 2007
1974 VERSION:2.0
1975 BEGIN:VTIMEZONE
1976 TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna
1977 BEGIN:STANDARD
1978 DTSTART:16010101T030000
1979 TZOFFSETFROM:+0200
1980 TZOFFSETTO:+0100
1981 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
1982 END:STANDARD
1983 BEGIN:DAYLIGHT
1984 DTSTART:16010101T020000
1985 TZOFFSETFROM:+0100
1986 TZOFFSETTO:+0200
1987 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
1988 END:DAYLIGHT
1989 END:VTIMEZONE
1990 BEGIN:VEVENT
1991 ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com
1992 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth
1993 er\":MAILTO:other.luser@foo.com
1994 DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n
1995 SUMMARY;LANGUAGE=en-US:Query
1996 DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\"
1997 :20120515T150000
1998 DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2
1999 0120515T153000
2000 UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000
2001 010000000575268034ECDB649A15349B1BF240F15
2002 RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V
2003 ienna\":20120515T170000
2004 CLASS:PUBLIC
2005 PRIORITY:5
2006 DTSTAMP:20120514T153645Z
2007 TRANSP:OPAQUE
2008 STATUS:CONFIRMED
2009 SEQUENCE:15
2010 LOCATION;LANGUAGE=en-US:phone
2011 X-MICROSOFT-CDO-APPT-SEQUENCE:15
2012 X-MICROSOFT-CDO-OWNERAPPTID:1907632092
2013 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
2014 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
2015 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
2016 X-MICROSOFT-CDO-IMPORTANCE:1
2017 X-MICROSOFT-CDO-INSTTYPE:3
2018 BEGIN:VALARM
2019 ACTION:DISPLAY
2020 DESCRIPTION:REMINDER
2021 TRIGGER;RELATED=START:-PT15M
2022 END:VALARM
2023 END:VEVENT
2024 END:VCALENDAR"
2025 nil
2026 "&15/5/2012 15:00-15:30 Query
2027 Location: phone
2028 Organizer: MAILTO:a.luser@foo.com
2029 Status: CONFIRMED
2030 Class: PUBLIC
2031 UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15
2032 " nil)
2033 )
2034
2035 (provide 'icalendar-tests)
2036 ;;; icalendar-tests.el ends here