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