Update copyright year to 2015
[emacs.git] / test / automated / icalendar-tests.el
blob68d0a400137e06b1224106cb7918bdee744b9b4c
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 ;; bug#11473
1322 (icalendar-tests--test-import
1323 "BEGIN:VCALENDAR
1324 BEGIN:VTIMEZONE
1325 TZID:fictional\, nonexistent\, arbitrary
1326 BEGIN:STANDARD
1327 DTSTART:20100101T000000
1328 TZOFFSETFROM:+0200
1329 TZOFFSETTO:-0200
1330 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01
1331 END:STANDARD
1332 BEGIN:DAYLIGHT
1333 DTSTART:20101201T000000
1334 TZOFFSETFROM:-0200
1335 TZOFFSETTO:+0200
1336 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
1337 END:DAYLIGHT
1338 END:VTIMEZONE
1339 BEGIN:VEVENT
1340 SUMMARY:standardtime
1341 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000
1342 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000
1343 END:VEVENT
1344 BEGIN:VEVENT
1345 SUMMARY:daylightsavingtime
1346 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000
1347 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000
1348 END:VEVENT
1349 END:VCALENDAR"
1350 ;; "standardtime" begins first sunday in january and is 4 hours behind CET
1351 ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET
1352 "&2012/1/15 15:00-15:30 standardtime
1353 &2012/12/15 11:00-11:30 daylightsavingtime
1356 nil)
1358 ;; ======================================================================
1359 ;; Cycle
1360 ;; ======================================================================
1361 (defun icalendar-tests--test-cycle (input)
1362 "Perform cycle test.
1363 Argument INPUT icalendar event string."
1364 (with-temp-buffer
1365 (if (string-match "^BEGIN:VCALENDAR" input)
1366 (insert input)
1367 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1368 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1369 (insert input)
1370 (unless (eq (char-before) ?\n)
1371 (insert "\n"))
1372 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1373 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
1374 (icalendar-import-format-summary "%s")
1375 (icalendar-import-format-location "\n Location: %s")
1376 (icalendar-import-format-description "\n Desc: %s")
1377 (icalendar-import-format-organizer "\n Organizer: %s")
1378 (icalendar-import-format-status "\n Status: %s")
1379 (icalendar-import-format-url "\n URL: %s")
1380 (icalendar-import-format-class "\n Class: %s")
1381 (icalendar-import-format-class "\n UID: %s")
1382 (icalendar-export-alarms nil))
1383 (dolist (calendar-date-style '(iso european american))
1384 (icalendar-tests--do-test-cycle)))))
1386 (defun icalendar-tests--do-test-cycle ()
1387 "Actually perform import/export cycle test."
1388 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1389 (temp-ics (make-temp-file "icalendar-test-ics"))
1390 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1392 (unwind-protect
1393 (progn
1394 ;; step 1: import
1395 (icalendar-import-buffer temp-diary t t)
1397 ;; step 2: export what was just imported
1398 (save-excursion
1399 (find-file temp-diary)
1400 (icalendar-export-region (point-min) (point-max) temp-ics))
1402 ;; compare the output of step 2 with the input of step 1
1403 (save-excursion
1404 (find-file temp-ics)
1405 (goto-char (point-min))
1406 ;;(when (re-search-forward "\nUID:.*\n" nil t)
1407 ;;(replace-match "\n"))
1408 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1409 (should (string= org-input cycled)))))
1410 ;; clean up
1411 (kill-buffer (find-buffer-visiting temp-diary))
1412 (with-current-buffer (find-buffer-visiting temp-ics)
1413 (set-buffer-modified-p nil)
1414 (kill-buffer (current-buffer)))
1415 (delete-file temp-diary)
1416 (delete-file temp-ics))))
1418 (ert-deftest icalendar-cycle ()
1419 "Perform cycling tests.
1420 Take care to avoid auto-generated UIDs here."
1421 (icalendar-tests--test-cycle
1422 "UID:dummyuid
1423 DTSTART;VALUE=DATE-TIME:20030919T090000
1424 DTEND;VALUE=DATE-TIME:20030919T113000
1425 SUMMARY:Cycletest
1427 (icalendar-tests--test-cycle
1428 "UID:blah
1429 DTSTART;VALUE=DATE-TIME:20030919T090000
1430 DTEND;VALUE=DATE-TIME:20030919T113000
1431 SUMMARY:Cycletest
1432 DESCRIPTION:beschreibung!
1433 LOCATION:nowhere
1434 ORGANIZER:ulf
1436 (icalendar-tests--test-cycle
1437 "UID:4711
1438 DTSTART;VALUE=DATE:19190909
1439 DTEND;VALUE=DATE:19190910
1440 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1441 SUMMARY:and diary-anniversary
1444 ;; ======================================================================
1445 ;; Real world
1446 ;; ======================================================================
1447 (ert-deftest icalendar-real-world ()
1448 "Perform real-world tests, as gathered from problem reports."
1449 ;; 2003-05-29
1450 (icalendar-tests--test-import
1451 "BEGIN:VCALENDAR
1452 METHOD:REQUEST
1453 PRODID:Microsoft CDO for Microsoft Exchange
1454 VERSION:2.0
1455 BEGIN:VTIMEZONE
1456 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
1457 X-MICROSOFT-CDO-TZID:23
1458 BEGIN:STANDARD
1459 DTSTART:16010101T000000
1460 TZOFFSETFROM:+0530
1461 TZOFFSETTO:+0530
1462 END:STANDARD
1463 BEGIN:DAYLIGHT
1464 DTSTART:16010101T000000
1465 TZOFFSETFROM:+0530
1466 TZOFFSETTO:+0530
1467 END:DAYLIGHT
1468 END:VTIMEZONE
1469 BEGIN:VEVENT
1470 DTSTAMP:20030509T043439Z
1471 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1472 SUMMARY:On-Site Interview
1473 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1474 010000000DB823520692542408ED02D7023F9DFF9
1475 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1476 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1477 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1478 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1479 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1480 zz\":MAILTO:zzzzzz@zzzzzzz.com
1481 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1482 LOCATION:Cccc
1483 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1484 DESCRIPTION:10:30am - Blah
1485 SEQUENCE:0
1486 PRIORITY:5
1487 CLASS:
1488 CREATED:20030509T043439Z
1489 LAST-MODIFIED:20030509T043459Z
1490 STATUS:CONFIRMED
1491 TRANSP:OPAQUE
1492 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1493 X-MICROSOFT-CDO-INSTTYPE:0
1494 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1495 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1496 X-MICROSOFT-CDO-IMPORTANCE:1
1497 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1498 BEGIN:VALARM
1499 ACTION:DISPLAY
1500 DESCRIPTION:REMINDER
1501 TRIGGER;RELATED=START:-PT00H15M00S
1502 END:VALARM
1503 END:VEVENT
1504 END:VCALENDAR"
1506 "&9/5/2003 07:00-12:00 On-Site Interview
1507 Desc: 10:30am - Blah
1508 Location: Cccc
1509 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1510 Status: CONFIRMED
1511 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1513 "&5/9/2003 07:00-12:00 On-Site Interview
1514 Desc: 10:30am - Blah
1515 Location: Cccc
1516 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1517 Status: CONFIRMED
1518 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1521 ;; created with http://apps.marudot.com/ical/
1522 (icalendar-tests--test-import
1523 "BEGIN:VCALENDAR
1524 VERSION:2.0
1525 PRODID:-//www.marudot.com//iCal Event Maker
1526 X-WR-CALNAME:Test
1527 CALSCALE:GREGORIAN
1528 BEGIN:VTIMEZONE
1529 TZID:Asia/Tehran
1530 TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran
1531 X-LIC-LOCATION:Asia/Tehran
1532 BEGIN:STANDARD
1533 TZOFFSETFROM:+0330
1534 TZOFFSETTO:+0330
1535 TZNAME:IRST
1536 DTSTART:19700101T000000
1537 END:STANDARD
1538 END:VTIMEZONE
1539 BEGIN:VEVENT
1540 DTSTAMP:20141116T171439Z
1541 UID:20141116T171439Z-678877132@marudot.com
1542 DTSTART;TZID=\"Asia/Tehran\":20141116T070000
1543 DTEND;TZID=\"Asia/Tehran\":20141116T080000
1544 SUMMARY:NoDST
1545 DESCRIPTION:Test event from timezone without DST
1546 LOCATION:Everywhere
1547 END:VEVENT
1548 END:VCALENDAR"
1550 "&16/11/2014 04:30-05:30 NoDST
1551 Desc: Test event from timezone without DST
1552 Location: Everywhere
1553 UID: 20141116T171439Z-678877132@marudot.com
1555 "&11/16/2014 04:30-05:30 NoDST
1556 Desc: Test event from timezone without DST
1557 Location: Everywhere
1558 UID: 20141116T171439Z-678877132@marudot.com
1562 ;; 2003-06-18 a
1563 (icalendar-tests--test-import
1564 "DTSTAMP:20030618T195512Z
1565 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1566 SUMMARY:Dress Rehearsal for XXXX-XXXX
1567 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1568 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1569 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1570 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1571 ORGANIZER;CN=\"ABCD,TECHTRAINING
1572 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1573 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1574 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1575 DESCRIPTION:753 Zeichen hier radiert
1576 SEQUENCE:0
1577 PRIORITY:5
1578 CLASS:
1579 CREATED:20030618T195518Z
1580 LAST-MODIFIED:20030618T195527Z
1581 STATUS:CONFIRMED
1582 TRANSP:OPAQUE
1583 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1584 X-MICROSOFT-CDO-INSTTYPE:0
1585 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1586 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1587 X-MICROSOFT-CDO-IMPORTANCE:1
1588 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1589 BEGIN:VALARM
1590 ACTION:DISPLAY
1591 DESCRIPTION:REMINDER
1592 TRIGGER;RELATED=START:-PT00H15M00S
1593 END:VALARM"
1595 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1596 Desc: 753 Zeichen hier radiert
1597 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1598 Organizer: MAILTO:xxx@xxxxx.com
1599 Status: CONFIRMED
1600 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1602 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1603 Desc: 753 Zeichen hier radiert
1604 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1605 Organizer: MAILTO:xxx@xxxxx.com
1606 Status: CONFIRMED
1607 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1609 ;; 2003-06-18 b -- uses timezone
1610 (icalendar-tests--test-import
1611 "BEGIN:VCALENDAR
1612 METHOD:REQUEST
1613 PRODID:Microsoft CDO for Microsoft Exchange
1614 VERSION:2.0
1615 BEGIN:VTIMEZONE
1616 TZID:Mountain Time (US & Canada)
1617 X-MICROSOFT-CDO-TZID:12
1618 BEGIN:STANDARD
1619 DTSTART:16010101T020000
1620 TZOFFSETFROM:-0600
1621 TZOFFSETTO:-0700
1622 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1623 END:STANDARD
1624 BEGIN:DAYLIGHT
1625 DTSTART:16010101T020000
1626 TZOFFSETFROM:-0700
1627 TZOFFSETTO:-0600
1628 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1629 END:DAYLIGHT
1630 END:VTIMEZONE
1631 BEGIN:VEVENT
1632 DTSTAMP:20030618T230323Z
1633 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1634 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1635 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1636 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1637 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1638 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1639 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1640 .com
1641 ORGANIZER;CN=\"ABCD,TECHTRAINING
1642 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1643 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1644 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1645 DESCRIPTION:Viele Zeichen standen hier früher
1646 SEQUENCE:0
1647 PRIORITY:5
1648 CLASS:
1649 CREATED:20030618T230326Z
1650 LAST-MODIFIED:20030618T230335Z
1651 STATUS:CONFIRMED
1652 TRANSP:OPAQUE
1653 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1654 X-MICROSOFT-CDO-INSTTYPE:0
1655 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1656 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1657 X-MICROSOFT-CDO-IMPORTANCE:1
1658 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1659 BEGIN:VALARM
1660 ACTION:DISPLAY
1661 DESCRIPTION:REMINDER
1662 TRIGGER;RELATED=START:-PT00H15M00S
1663 END:VALARM
1664 END:VEVENT
1665 END:VCALENDAR"
1667 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1668 Desc: Viele Zeichen standen hier früher
1669 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1670 Organizer: MAILTO:bbb@bbbbb.com
1671 Status: CONFIRMED
1672 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1674 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1675 Desc: Viele Zeichen standen hier früher
1676 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1677 Organizer: MAILTO:bbb@bbbbb.com
1678 Status: CONFIRMED
1679 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1681 ;; export 2004-10-28 block entries
1682 (icalendar-tests--test-export
1685 "-*- mode: text; fill-column: 256;-*-
1687 >>> block entries:
1689 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1691 "DTSTART;VALUE=DATE:20041108
1692 DTEND;VALUE=DATE:20041111
1693 SUMMARY:Nov 8-10 aa")
1695 (icalendar-tests--test-export
1698 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1699 "DTSTART;VALUE=DATE:20041213
1700 DTEND;VALUE=DATE:20041218
1701 SUMMARY:Dec 13-17 bb")
1703 (icalendar-tests--test-export
1706 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1707 "DTSTART;VALUE=DATE:20050203
1708 DTEND;VALUE=DATE:20050205
1709 SUMMARY:Feb 3-4 cc")
1711 (icalendar-tests--test-export
1714 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1715 "DTSTART;VALUE=DATE:20050424
1716 DTEND;VALUE=DATE:20050430
1717 SUMMARY:April 24-29 dd
1719 (icalendar-tests--test-export
1722 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1723 "DTSTART;VALUE=DATE:20050530
1724 DTEND;VALUE=DATE:20050602
1725 SUMMARY:may 30 - June 1: ee")
1727 (icalendar-tests--test-export
1730 "%%(diary-block 6 6 2005 6 8 2005) ff"
1731 "DTSTART;VALUE=DATE:20050606
1732 DTEND;VALUE=DATE:20050609
1733 SUMMARY:ff")
1735 ;; export 2004-10-28 anniversary entries
1736 (icalendar-tests--test-export
1740 >>> anniversaries:
1742 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1743 "DTSTART;VALUE=DATE:19910328
1744 DTEND;VALUE=DATE:19910329
1745 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1746 SUMMARY:aa birthday (%d years old)
1749 (icalendar-tests--test-export
1752 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1753 "DTSTART;VALUE=DATE:19570517
1754 DTEND;VALUE=DATE:19570518
1755 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1756 SUMMARY:bb birthday (%d years old)")
1758 (icalendar-tests--test-export
1761 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1762 "DTSTART;VALUE=DATE:19970608
1763 DTEND;VALUE=DATE:19970609
1764 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1765 SUMMARY:cc birthday (%d years old)")
1767 (icalendar-tests--test-export
1770 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1771 "DTSTART;VALUE=DATE:19830722
1772 DTEND;VALUE=DATE:19830723
1773 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1774 SUMMARY:dd (%d years ago...!)")
1776 (icalendar-tests--test-export
1779 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1780 "DTSTART;VALUE=DATE:19880801
1781 DTEND;VALUE=DATE:19880802
1782 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1783 SUMMARY:ee birthday (%d years old)")
1785 (icalendar-tests--test-export
1788 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1789 "DTSTART;VALUE=DATE:19570921
1790 DTEND;VALUE=DATE:19570922
1791 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1792 SUMMARY:ff birthday (%d years old)")
1795 ;; FIXME!
1797 ;; export 2004-10-28 monthly, weekly entries
1799 ;; (icalendar-tests--test-export
1800 ;; nil
1801 ;; "
1802 ;; >>> ------------ monthly:
1804 ;; */27/* 10:00 blah blah"
1805 ;; "xxx")
1807 (icalendar-tests--test-export
1810 ">>> ------------ my week:
1812 Monday 13:00 MAC"
1813 "DTSTART;VALUE=DATE-TIME:20000103T130000
1814 DTEND;VALUE=DATE-TIME:20000103T140000
1815 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1816 SUMMARY:MAC")
1818 (icalendar-tests--test-export
1821 "Monday 15:00 a1"
1822 "DTSTART;VALUE=DATE-TIME:20000103T150000
1823 DTEND;VALUE=DATE-TIME:20000103T160000
1824 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1825 SUMMARY:a1")
1828 (icalendar-tests--test-export
1831 "Monday 16:00-17:00 a2"
1832 "DTSTART;VALUE=DATE-TIME:20000103T160000
1833 DTEND;VALUE=DATE-TIME:20000103T170000
1834 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1835 SUMMARY:a2")
1837 (icalendar-tests--test-export
1840 "Tuesday 11:30-13:00 a3"
1841 "DTSTART;VALUE=DATE-TIME:20000104T113000
1842 DTEND;VALUE=DATE-TIME:20000104T130000
1843 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1844 SUMMARY:a3")
1846 (icalendar-tests--test-export
1849 "Tuesday 15:00 a4"
1850 "DTSTART;VALUE=DATE-TIME:20000104T150000
1851 DTEND;VALUE=DATE-TIME:20000104T160000
1852 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1853 SUMMARY:a4")
1855 (icalendar-tests--test-export
1858 "Wednesday 13:00 a5"
1859 "DTSTART;VALUE=DATE-TIME:20000105T130000
1860 DTEND;VALUE=DATE-TIME:20000105T140000
1861 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1862 SUMMARY:a5")
1864 (icalendar-tests--test-export
1867 "Wednesday 11:30-13:30 a6"
1868 "DTSTART;VALUE=DATE-TIME:20000105T113000
1869 DTEND;VALUE=DATE-TIME:20000105T133000
1870 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1871 SUMMARY:a6")
1873 (icalendar-tests--test-export
1876 "Wednesday 15:00 s1"
1877 "DTSTART;VALUE=DATE-TIME:20000105T150000
1878 DTEND;VALUE=DATE-TIME:20000105T160000
1879 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1880 SUMMARY:s1")
1883 ;; export 2004-10-28 regular entries
1884 (icalendar-tests--test-export
1888 >>> regular diary entries:
1890 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1891 "DTSTART;VALUE=DATE-TIME:20041012T140000
1892 DTEND;VALUE=DATE-TIME:20041012T150000
1893 SUMMARY:Tue: [2004-10-12] q1")
1895 ;; 2004-11-19
1896 (icalendar-tests--test-import
1897 "BEGIN:VCALENDAR
1898 VERSION
1899 :2.0
1900 PRODID
1901 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1902 BEGIN:VEVENT
1903 SUMMARY
1904 :Jjjjj & Wwwww
1905 STATUS
1906 :TENTATIVE
1907 CLASS
1908 :PRIVATE
1909 X-MOZILLA-ALARM-DEFAULT-LENGTH
1911 DTSTART
1912 :20041123T140000
1913 DTEND
1914 :20041123T143000
1915 DTSTAMP
1916 :20041118T013430Z
1917 LAST-MODIFIED
1918 :20041118T013640Z
1919 END:VEVENT
1920 BEGIN:VEVENT
1921 SUMMARY
1922 :BB Aaaaaaaa Bbbbb
1923 STATUS
1924 :TENTATIVE
1925 CLASS
1926 :PRIVATE
1927 X-MOZILLA-ALARM-DEFAULT-LENGTH
1929 DTSTART
1930 :20041123T144500
1931 DTEND
1932 :20041123T154500
1933 DTSTAMP
1934 :20041118T013641Z
1935 END:VEVENT
1936 BEGIN:VEVENT
1937 SUMMARY
1938 :Hhhhhhhh
1939 STATUS
1940 :TENTATIVE
1941 CLASS
1942 :PRIVATE
1943 X-MOZILLA-ALARM-DEFAULT-LENGTH
1945 DTSTART
1946 :20041123T110000
1947 DTEND
1948 :20041123T120000
1949 DTSTAMP
1950 :20041118T013831Z
1951 END:VEVENT
1952 BEGIN:VEVENT
1953 SUMMARY
1954 :MMM Aaaaaaaaa
1955 STATUS
1956 :TENTATIVE
1957 CLASS
1958 :PRIVATE
1959 X-MOZILLA-ALARM-DEFAULT-LENGTH
1961 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1963 RRULE
1964 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1965 DTSTART
1966 :20041112T140000
1967 DTEND
1968 :20041112T183000
1969 DTSTAMP
1970 :20041118T014117Z
1971 END:VEVENT
1972 BEGIN:VEVENT
1973 SUMMARY
1974 :Rrrr/Cccccc ii Aaaaaaaa
1975 DESCRIPTION
1976 :Vvvvv Rrrr aaa Cccccc
1977 STATUS
1978 :TENTATIVE
1979 CLASS
1980 :PRIVATE
1981 X-MOZILLA-ALARM-DEFAULT-LENGTH
1983 DTSTART
1984 ;VALUE=DATE
1985 :20041119
1986 DTEND
1987 ;VALUE=DATE
1988 :20041120
1989 DTSTAMP
1990 :20041118T013107Z
1991 LAST-MODIFIED
1992 :20041118T014203Z
1993 END:VEVENT
1994 BEGIN:VEVENT
1995 SUMMARY
1996 :Wwww aa hhhh
1997 STATUS
1998 :TENTATIVE
1999 CLASS
2000 :PRIVATE
2001 X-MOZILLA-ALARM-DEFAULT-LENGTH
2003 RRULE
2004 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
2005 DTSTART
2006 ;VALUE=DATE
2007 :20041101
2008 DTEND
2009 ;VALUE=DATE
2010 :20041102
2011 DTSTAMP
2012 :20041118T014045Z
2013 LAST-MODIFIED
2014 :20041118T023846Z
2015 END:VEVENT
2016 END:VCALENDAR
2019 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
2020 Status: TENTATIVE
2021 Class: PRIVATE
2022 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
2023 Status: TENTATIVE
2024 Class: PRIVATE
2025 &23/11/2004 11:00-12:00 Hhhhhhhh
2026 Status: TENTATIVE
2027 Class: PRIVATE
2028 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
2029 Status: TENTATIVE
2030 Class: PRIVATE
2031 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
2032 Desc: Vvvvv Rrrr aaa Cccccc
2033 Status: TENTATIVE
2034 Class: PRIVATE
2035 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
2036 Status: TENTATIVE
2037 Class: PRIVATE
2039 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
2040 Status: TENTATIVE
2041 Class: PRIVATE
2042 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
2043 Status: TENTATIVE
2044 Class: PRIVATE
2045 &11/23/2004 11:00-12:00 Hhhhhhhh
2046 Status: TENTATIVE
2047 Class: PRIVATE
2048 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
2049 Status: TENTATIVE
2050 Class: PRIVATE
2051 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
2052 Desc: Vvvvv Rrrr aaa Cccccc
2053 Status: TENTATIVE
2054 Class: PRIVATE
2055 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
2056 Status: TENTATIVE
2057 Class: PRIVATE
2060 ;; 2004-09-09 pg
2061 (icalendar-tests--test-export
2062 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
2065 "DTSTART;VALUE=DATE:20040101
2066 DTEND;VALUE=DATE:20040105
2067 SUMMARY:Urlaub")
2069 ;; 2004-10-25 pg
2070 (icalendar-tests--test-export
2072 "5 11 2004 Bla Fasel"
2074 "DTSTART;VALUE=DATE:20041105
2075 DTEND;VALUE=DATE:20041106
2076 SUMMARY:Bla Fasel")
2078 ;; 2004-10-30 pg
2079 (icalendar-tests--test-export
2081 "2 Nov 2004 15:00-16:30 Zahnarzt"
2083 "DTSTART;VALUE=DATE-TIME:20041102T150000
2084 DTEND;VALUE=DATE-TIME:20041102T163000
2085 SUMMARY:Zahnarzt")
2087 ;; 2005-02-07 lt
2088 (icalendar-tests--test-import
2089 "UID
2090 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
2091 SUMMARY
2092 :Waitangi Day
2093 DESCRIPTION
2094 :abcdef
2095 CATEGORIES
2096 :Public Holiday
2097 STATUS
2098 :CONFIRMED
2099 CLASS
2100 :PRIVATE
2101 DTSTART
2102 ;VALUE=DATE
2103 :20050206
2104 DTEND
2105 ;VALUE=DATE
2106 :20050207
2107 DTSTAMP
2108 :20050128T011209Z"
2110 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
2111 Desc: abcdef
2112 Status: CONFIRMED
2113 Class: PRIVATE
2114 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
2116 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
2117 Desc: abcdef
2118 Status: CONFIRMED
2119 Class: PRIVATE
2120 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
2123 ;; 2005-03-01 lt
2124 (icalendar-tests--test-import
2125 "DTSTART;VALUE=DATE:20050217
2126 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
2127 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
2128 DTSTAMP:20050118T210335Z
2129 DURATION:P7D"
2131 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
2132 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n"
2133 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
2134 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n")
2136 ;; 2005-03-23 lt
2137 (icalendar-tests--test-export
2139 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
2141 "DTSTART;VALUE=DATE-TIME:20050208T160000
2142 DTEND;VALUE=DATE-TIME:20050208T164500
2143 RRULE:FREQ=DAILY;INTERVAL=7
2144 SUMMARY:[WORK] Pppp
2147 ;; 2005-05-27 eu
2148 (icalendar-tests--test-export
2151 ;; FIXME: colon not allowed!
2152 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
2153 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
2154 "DTSTART;VALUE=DATE:19001101
2155 DTEND;VALUE=DATE:19001102
2156 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
2157 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
2160 ;; bug#11473
2161 (icalendar-tests--test-import
2162 "BEGIN:VCALENDAR
2163 METHOD:REQUEST
2164 PRODID:Microsoft Exchange Server 2007
2165 VERSION:2.0
2166 BEGIN:VTIMEZONE
2167 TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna
2168 BEGIN:STANDARD
2169 DTSTART:16010101T030000
2170 TZOFFSETFROM:+0200
2171 TZOFFSETTO:+0100
2172 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
2173 END:STANDARD
2174 BEGIN:DAYLIGHT
2175 DTSTART:16010101T020000
2176 TZOFFSETFROM:+0100
2177 TZOFFSETTO:+0200
2178 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
2179 END:DAYLIGHT
2180 END:VTIMEZONE
2181 BEGIN:VEVENT
2182 ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com
2183 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth
2184 er\":MAILTO:other.luser@foo.com
2185 DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n
2186 SUMMARY;LANGUAGE=en-US:Query
2187 DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\"
2188 :20120515T150000
2189 DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2
2190 0120515T153000
2191 UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000
2192 010000000575268034ECDB649A15349B1BF240F15
2193 RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V
2194 ienna\":20120515T170000
2195 CLASS:PUBLIC
2196 PRIORITY:5
2197 DTSTAMP:20120514T153645Z
2198 TRANSP:OPAQUE
2199 STATUS:CONFIRMED
2200 SEQUENCE:15
2201 LOCATION;LANGUAGE=en-US:phone
2202 X-MICROSOFT-CDO-APPT-SEQUENCE:15
2203 X-MICROSOFT-CDO-OWNERAPPTID:1907632092
2204 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
2205 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
2206 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
2207 X-MICROSOFT-CDO-IMPORTANCE:1
2208 X-MICROSOFT-CDO-INSTTYPE:3
2209 BEGIN:VALARM
2210 ACTION:DISPLAY
2211 DESCRIPTION:REMINDER
2212 TRIGGER;RELATED=START:-PT15M
2213 END:VALARM
2214 END:VEVENT
2215 END:VCALENDAR"
2217 "&15/5/2012 15:00-15:30 Query
2218 Location: phone
2219 Organizer: MAILTO:a.luser@foo.com
2220 Status: CONFIRMED
2221 Class: PUBLIC
2222 UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15
2223 " nil)
2226 (provide 'icalendar-tests)
2227 ;;; icalendar-tests.el ends here