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