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