1 ;; icalendar-tests.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008-2014 Free Software Foundation, Inc.
5 ;; Author: Ulf Jasper <ulf.jasper@web.de>
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/>.
28 ;; - Add more unit tests for functions, timezone etc.
30 ;; Note: Watch the trailing blank that is added on import.
37 ;; ======================================================================
39 ;; ======================================================================
41 (defun icalendar-tests--get-ical-event (ical-string)
42 "Return iCalendar event for 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 ;; ======================================================================
56 ;; ======================================================================
58 (ert-deftest icalendar--create-uid ()
59 "Test for `icalendar--create-uid'."
60 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
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))
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)
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")
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)
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")
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)
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")
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)
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")
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)
143 (calendar-day-name-array
144 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
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")
152 (should (string= "subject" (cdr result)))))
154 (ert-deftest icalendar--convert-sexp-to-ical ()
155 "Test method for `icalendar--convert-sexp-to-ical'."
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)))
164 (should (string-match "Hebrew date (until sunset): .*" (cdr i))))
167 (ert-deftest icalendar--convert-to-ical ()
168 "Test method for `icalendar--convert-to-ical'."
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"
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
197 DTSTART:16010101T040000
200 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
203 DTSTART:16010101T030000
206 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
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"
215 (setq vtimezone (icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
216 TZID:anothername\, with a comma
218 DTSTART:16010101T040000
221 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
224 DTSTART:16010101T030000
227 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
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"
237 (ert-deftest icalendar--convert-ordinary-to-ical ()
238 "Test method for `icalendar--convert-ordinary-to-ical'."
239 (let* ((calendar-date-style 'iso)
242 (setq result (icalendar--convert-ordinary-to-ical "&?" "2010 2 15 subject"))
243 (should (consp result))
244 (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216"
246 (should (string= "subject" (cdr result)))
249 (setq result (icalendar--convert-ordinary-to-ical
250 "&?" "&2010 2 15 12:34 s"))
251 (should (consp result))
252 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
253 "\nDTEND;VALUE=DATE-TIME:20100215T133400")
255 (should (string= "s" (cdr result)))
258 (setq result (icalendar--convert-ordinary-to-ical
259 "&?" "&2010 2 15 12:34-23:45 s"))
260 (should (consp result))
261 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
262 "\nDTEND;VALUE=DATE-TIME:20100215T234500")
264 (should (string= "s" (cdr result)))
266 ;; with time, again -- test bug#5549
267 (setq result (icalendar--convert-ordinary-to-ical
268 "x?" "x2010 2 15 0:34-1:45 s"))
269 (should (consp result))
270 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400"
271 "\nDTEND;VALUE=DATE-TIME:20100215T014500")
273 (should (string= "s" (cdr result)))))
275 (ert-deftest icalendar--diarytime-to-isotime ()
276 "Test method for `icalendar--diarytime-to-isotime'."
277 (should (string= "T011500"
278 (icalendar--diarytime-to-isotime "01:15" "")))
279 (should (string= "T011500"
280 (icalendar--diarytime-to-isotime "1:15" "")))
281 (should (string= "T000100"
282 (icalendar--diarytime-to-isotime "0:01" "")))
283 (should (string= "T010000"
284 (icalendar--diarytime-to-isotime "0100" "")))
285 (should (string= "T010000"
286 (icalendar--diarytime-to-isotime "0100" "am")))
287 (should (string= "T130000"
288 (icalendar--diarytime-to-isotime "0100" "pm")))
289 (should (string= "T120000"
290 (icalendar--diarytime-to-isotime "1200" "")))
291 (should (string= "T171700"
292 (icalendar--diarytime-to-isotime "17:17" "")))
293 (should (string= "T000000"
294 (icalendar--diarytime-to-isotime "1200" "am")))
295 (should (string= "T000100"
296 (icalendar--diarytime-to-isotime "1201" "am")))
297 (should (string= "T005900"
298 (icalendar--diarytime-to-isotime "1259" "am")))
299 (should (string= "T120000"
300 (icalendar--diarytime-to-isotime "1200" "pm")))
301 (should (string= "T120100"
302 (icalendar--diarytime-to-isotime "1201" "pm")))
303 (should (string= "T125900"
304 (icalendar--diarytime-to-isotime "1259" "pm")))
305 (should (string= "T150000"
306 (icalendar--diarytime-to-isotime "3" "pm"))))
308 (ert-deftest icalendar--datetime-to-diary-date ()
309 "Test method for `icalendar--datetime-to-diary-date'."
310 (let* ((datetime '(59 59 23 31 12 2008))
311 (calendar-date-style 'iso))
312 (should (string= "2008 12 31"
313 (icalendar--datetime-to-diary-date datetime)))
314 (setq calendar-date-style 'european)
315 (should (string= "31 12 2008"
316 (icalendar--datetime-to-diary-date datetime)))
317 (setq calendar-date-style 'american)
318 (should (string= "12 31 2008"
319 (icalendar--datetime-to-diary-date datetime)))))
321 (ert-deftest icalendar--datestring-to-isodate ()
322 "Test method for `icalendar--datestring-to-isodate'."
323 (let ((calendar-date-style 'iso))
325 (should (string= "20080511"
326 (icalendar--datestring-to-isodate "2008 05 11")))
327 (should (string= "20080531"
328 (icalendar--datestring-to-isodate "2008 05 31")))
329 (should (string= "20080602"
330 (icalendar--datestring-to-isodate "2008 05 31" 2)))
333 (setq calendar-date-style 'european)
334 (should (string= "20080511"
335 (icalendar--datestring-to-isodate "11 05 2008")))
336 (should (string= "20080531"
337 (icalendar--datestring-to-isodate "31 05 2008")))
338 (should (string= "20080602"
339 (icalendar--datestring-to-isodate "31 05 2008" 2)))
342 (setq calendar-date-style 'american)
343 (should (string= "20081105"
344 (icalendar--datestring-to-isodate "11 05 2008")))
345 (should (string= "20081230"
346 (icalendar--datestring-to-isodate "12 30 2008")))
347 (should (string= "20090101"
348 (icalendar--datestring-to-isodate "12 30 2008" 2)))
351 (setq calendar-date-style nil) ;not necessary for conversion
352 (should (string= "20081105"
353 (icalendar--datestring-to-isodate "Nov 05 2008")))
354 (should (string= "20081105"
355 (icalendar--datestring-to-isodate "05 Nov 2008")))
356 (should (string= "20081105"
357 (icalendar--datestring-to-isodate "2008 Nov 05")))))
359 (ert-deftest icalendar--first-weekday-of-year ()
360 "Test method for `icalendar-first-weekday-of-year'."
361 (should (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
362 (should (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
363 (should (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
364 (should (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
365 (should (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
366 (should (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
367 (should (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
368 (should (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
369 (should (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
371 (ert-deftest icalendar--import-format-sample ()
372 "Test method for `icalendar-import-format-sample'."
373 (should (string= (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
374 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'")
375 (icalendar-import-format-sample
376 (icalendar-tests--get-ical-event "BEGIN:VEVENT
377 DTSTAMP:20030509T043439Z
378 DTSTART:20030509T103000
382 DTEND:20030509T153000
387 (ert-deftest icalendar--format-ical-event ()
388 "Test `icalendar--format-ical-event'."
389 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
390 (icalendar-import-format-summary "SUM %s")
391 (icalendar-import-format-location " LOC %s")
392 (icalendar-import-format-description " DES %s")
393 (icalendar-import-format-organizer " ORG %s")
394 (icalendar-import-format-status " STA %s")
395 (icalendar-import-format-url " URL %s")
396 (icalendar-import-format-class " CLA %s")
397 (event (icalendar-tests--get-ical-event "BEGIN:VEVENT
398 DTSTAMP:20030509T043439Z
399 DTSTART:20030509T103000
403 DTEND:20030509T153000
407 (should (string= "SUM sum DES des LOC loc ORG org"
408 (icalendar--format-ical-event event)))
409 (setq icalendar-import-format (lambda (&rest ignore)
411 (should (string= "helloworld" (icalendar--format-ical-event event)))
412 (setq icalendar-import-format
414 (format "-%s-%s-%s-%s-%s-%s-%s-"
415 (icalendar--get-event-property event 'SUMMARY)
416 (icalendar--get-event-property event 'DESCRIPTION)
417 (icalendar--get-event-property event 'LOCATION)
418 (icalendar--get-event-property event 'ORGANIZER)
419 (icalendar--get-event-property event 'STATUS)
420 (icalendar--get-event-property event 'URL)
421 (icalendar--get-event-property event 'CLASS))))
422 (should (string= "-sum-des-loc-org-nil-nil-nil-"
423 (icalendar--format-ical-event event)))))
425 (ert-deftest icalendar--parse-summary-and-rest ()
426 "Test `icalendar--parse-summary-and-rest'."
427 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
428 (icalendar-import-format-summary "SUM %s")
429 (icalendar-import-format-location " LOC %s")
430 (icalendar-import-format-description " DES %s")
431 (icalendar-import-format-organizer " ORG %s")
432 (icalendar-import-format-status " STA %s")
433 (icalendar-import-format-url " URL %s")
434 (icalendar-import-format-class " CLA %s")
436 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org"))
437 (should (string= "org" (cdr (assoc 'org result))))
439 (setq result (icalendar--parse-summary-and-rest
440 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
441 (should (string= "des" (cdr (assoc 'des result))))
442 (should (string= "loc" (cdr (assoc 'loc result))))
443 (should (string= "org" (cdr (assoc 'org result))))
444 (should (string= "sta" (cdr (assoc 'sta result))))
445 (should (string= "cla" (cdr (assoc 'cla result))))
447 (setq icalendar-import-format (lambda () "Hello world"))
448 (setq result (icalendar--parse-summary-and-rest
450 (should (not result))
453 (ert-deftest icalendar--decode-isodatetime ()
454 "Test `icalendar--decode-isodatetime'."
455 (let ((tz (getenv "TZ"))
459 ;; Use Eastern European Time (UTC+2, UTC+3 daylight saving)
460 (setenv "TZ" "EET-2EEST,M3.5.0/3,M10.5.0/4")
462 (message "%s" (current-time-zone (encode-time 0 0 10 1 1 2013 0)))
463 (message "%s" (current-time-zone (encode-time 0 0 10 1 8 2013 0)))
465 ;; testcase: no time zone in input -> keep time as is
467 (should (equal '(0 0 10 1 1 2013 2 nil 7200)
468 (icalendar--decode-isodatetime "20130101T100000")))
469 ;; 1 Aug 2013 10:00 (DST)
470 (should (equal '(0 0 10 1 8 2013 4 t 10800)
471 (icalendar--decode-isodatetime "20130801T100000")))
473 ;; testcase: UTC time zone specifier in input -> convert to local time
474 ;; 31 Dec 2013 23:00 UTC -> 1 Jan 2013 01:00 EET
475 (should (equal '(0 0 1 1 1 2014 3 nil 7200)
476 (icalendar--decode-isodatetime "20131231T230000Z")))
477 ;; 1 Aug 2013 10:00 UTC -> 1 Aug 2013 13:00 EEST
478 (should (equal '(0 0 13 1 8 2013 4 t 10800)
479 (icalendar--decode-isodatetime "20130801T100000Z")))
482 ;; restore time-zone even if something went terribly wrong
485 ;; ======================================================================
487 ;; ======================================================================
489 (defun icalendar-tests--test-export (input-iso input-european input-american
491 "Perform an export test.
492 Argument INPUT-ISO iso style diary string.
493 Argument INPUT-EUROPEAN european style diary string.
494 Argument INPUT-AMERICAN american style diary string.
495 Argument EXPECTED-OUTPUT expected iCalendar result string.
497 European style input data must use german month names. American
498 and ISO style input data must use english month names."
499 (let ((tz (getenv "TZ"))
500 (calendar-date-style 'iso)
501 (icalendar-recurring-start-year 2000))
504 ;;; (message "Current time zone: %s" (current-time-zone))
505 ;; Use this form so as not to rely on system tz database.
506 ;; Eg hydra.nixos.org.
507 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
508 ;;; (message "Current time zone: %s" (current-time-zone))
510 (let ((calendar-month-name-array
511 ["January" "February" "March" "April" "May" "June" "July" "August"
512 "September" "October" "November" "December"])
513 (calendar-day-name-array
514 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
516 (setq calendar-date-style 'iso)
517 (icalendar-tests--do-test-export input-iso expected-output)))
519 (let ((calendar-month-name-array
520 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
521 "September" "Oktober" "November" "Dezember"])
522 (calendar-day-name-array
523 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
525 (setq calendar-date-style 'european)
526 (icalendar-tests--do-test-export input-european expected-output)))
528 (let ((calendar-month-name-array
529 ["January" "February" "March" "April" "May" "June" "July" "August"
530 "September" "October" "November" "December"])
531 (calendar-day-name-array
532 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
534 (setq calendar-date-style 'american)
535 (icalendar-tests--do-test-export input-american expected-output))))
536 ;; restore time-zone even if something went terribly wrong
539 (defun icalendar-tests--do-test-export (input expected-output)
540 "Actually perform export test.
541 Argument INPUT input diary string.
542 Argument EXPECTED-OUTPUT expected iCalendar result string."
543 (let ((temp-file (make-temp-file "icalendar-tests-ics")))
548 (icalendar-export-region (point-min) (point-max) temp-file))
550 (find-file temp-file)
551 (goto-char (point-min))
552 (cond (expected-output
553 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
554 PRODID:-//Emacs//NONSGML icalendar.el//EN
563 (should (string-match
565 (regexp-quote (buffer-substring-no-properties
566 (match-beginning 1) (match-end 1)))
570 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
571 PRODID:-//Emacs//NONSGML icalendar.el//EN
577 (kill-buffer (find-buffer-visiting temp-file))
578 (delete-file temp-file))))
580 (ert-deftest icalendar-export-ordinary-no-time ()
581 "Perform export test."
583 (let ((icalendar-export-hidden-diary-entries nil))
584 (icalendar-tests--test-export
585 "&2000 Oct 3 ordinary no time "
586 "&3 Okt 2000 ordinary no time "
587 "&Oct 3 2000 ordinary no time "
590 (icalendar-tests--test-export
591 "2000 Oct 3 ordinary no time "
592 "3 Okt 2000 ordinary no time "
593 "Oct 3 2000 ordinary no time "
594 "DTSTART;VALUE=DATE:20001003
595 DTEND;VALUE=DATE:20001004
596 SUMMARY:ordinary no time
599 (ert-deftest icalendar-export-ordinary ()
600 "Perform export test."
602 (icalendar-tests--test-export
603 "2000 Oct 3 16:30 ordinary with time"
604 "3 Okt 2000 16:30 ordinary with time"
605 "Oct 3 2000 16:30 ordinary with time"
606 "DTSTART;VALUE=DATE-TIME:20001003T163000
607 DTEND;VALUE=DATE-TIME:20001003T173000
608 SUMMARY:ordinary with time
610 (icalendar-tests--test-export
611 "2000 10 3 16:30 ordinary with time 2"
612 "3 10 2000 16:30 ordinary with time 2"
613 "10 3 2000 16:30 ordinary with time 2"
614 "DTSTART;VALUE=DATE-TIME:20001003T163000
615 DTEND;VALUE=DATE-TIME:20001003T173000
616 SUMMARY:ordinary with time 2
619 (icalendar-tests--test-export
620 "2000/10/3 16:30 ordinary with time 3"
621 "3/10/2000 16:30 ordinary with time 3"
622 "10/3/2000 16:30 ordinary with time 3"
623 "DTSTART;VALUE=DATE-TIME:20001003T163000
624 DTEND;VALUE=DATE-TIME:20001003T173000
625 SUMMARY:ordinary with time 3
628 (ert-deftest icalendar-export-multiline ()
629 "Perform export test."
631 ;; multiline -- FIXME!!!
632 (icalendar-tests--test-export
633 "2000 October 3 16:30 multiline
634 17:30 multiline continued FIXME"
635 "3 Oktober 2000 16:30 multiline
636 17:30 multiline continued FIXME"
637 "October 3 2000 16:30 multiline
638 17:30 multiline continued FIXME"
639 "DTSTART;VALUE=DATE-TIME:20001003T163000
640 DTEND;VALUE=DATE-TIME:20001003T173000
643 17:30 multiline continued FIXME
646 (ert-deftest icalendar-export-weekly-by-day ()
647 "Perform export test."
650 (icalendar-tests--test-export
651 "Monday 1:30pm weekly by day with start time"
652 "Montag 13:30 weekly by day with start time"
653 "Monday 1:30pm weekly by day with start time"
654 "DTSTART;VALUE=DATE-TIME:20000103T133000
655 DTEND;VALUE=DATE-TIME:20000103T143000
656 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
657 SUMMARY:weekly by day with start time
660 (icalendar-tests--test-export
661 "Monday 13:30-15:00 weekly by day with start and end time"
662 "Montag 13:30-15:00 weekly by day with start and end time"
663 "Monday 01:30pm-03:00pm weekly by day with start and end time"
664 "DTSTART;VALUE=DATE-TIME:20000103T133000
665 DTEND;VALUE=DATE-TIME:20000103T150000
666 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
667 SUMMARY:weekly by day with start and end time
670 (ert-deftest icalendar-export-yearly ()
671 "Perform export test."
673 (icalendar-tests--test-export
674 "may 1 yearly no time"
675 "1 Mai yearly no time"
676 "may 1 yearly no time"
677 "DTSTART;VALUE=DATE:19000501
678 DTEND;VALUE=DATE:19000502
679 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
680 SUMMARY:yearly no time
683 (ert-deftest icalendar-export-anniversary ()
684 "Perform export test."
686 (icalendar-tests--test-export
687 "%%(diary-anniversary 1989 10 3) anniversary no time"
688 "%%(diary-anniversary 3 10 1989) anniversary no time"
689 "%%(diary-anniversary 10 3 1989) anniversary no time"
690 "DTSTART;VALUE=DATE:19891003
691 DTEND;VALUE=DATE:19891004
692 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
693 SUMMARY:anniversary no time
695 (icalendar-tests--test-export
696 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
697 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
698 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
699 "DTSTART;VALUE=DATE-TIME:19891003T190000
700 DTEND;VALUE=DATE-TIME:19891004T200000
701 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
702 SUMMARY:anniversary with time
705 (ert-deftest icalendar-export-block ()
706 "Perform export test."
708 (icalendar-tests--test-export
709 "%%(diary-block 2001 6 18 2001 7 6) block no time"
710 "%%(diary-block 18 6 2001 6 7 2001) block no time"
711 "%%(diary-block 6 18 2001 7 6 2001) block no time"
712 "DTSTART;VALUE=DATE:20010618
713 DTEND;VALUE=DATE:20010707
714 SUMMARY:block no time
716 (icalendar-tests--test-export
717 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
718 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
719 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
720 "DTSTART;VALUE=DATE-TIME:20010618T130000
721 DTEND;VALUE=DATE-TIME:20010618T170000
722 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
723 SUMMARY:block with time
725 (icalendar-tests--test-export
726 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
727 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
728 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
729 "DTSTART;VALUE=DATE-TIME:20010618T130000
730 DTEND;VALUE=DATE-TIME:20010618T140000
731 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
732 SUMMARY:block no end time
735 ;; ======================================================================
737 ;; ======================================================================
739 (defun icalendar-tests--test-import (input expected-iso expected-european
741 "Perform import test.
742 Argument INPUT icalendar event string.
743 Argument EXPECTED-ISO expected iso style diary string.
744 Argument EXPECTED-EUROPEAN expected european style diary string.
745 Argument EXPECTED-AMERICAN expected american style diary string."
746 (let ((timezone (getenv "TZ")))
749 ;;; (message "Current time zone: %s" (current-time-zone))
750 ;; Use this form so as not to rely on system tz database.
751 ;; Eg hydra.nixos.org.
752 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
753 ;;; (message "Current time zone: %s" (current-time-zone))
755 (if (string-match "^BEGIN:VCALENDAR" input)
757 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
758 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
760 (unless (eq (char-before) ?\n)
762 (insert "END:VEVENT\nEND:VCALENDAR\n"))
763 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
764 (icalendar-import-format-summary "%s")
765 (icalendar-import-format-location "\n Location: %s")
766 (icalendar-import-format-description "\n Desc: %s")
767 (icalendar-import-format-organizer "\n Organizer: %s")
768 (icalendar-import-format-status "\n Status: %s")
769 (icalendar-import-format-url "\n URL: %s")
770 (icalendar-import-format-class "\n Class: %s")
771 (icalendar-import-format-uid "\n UID: %s")
774 (setq calendar-date-style 'iso)
775 (icalendar-tests--do-test-import input expected-iso))
776 (when expected-european
777 (setq calendar-date-style 'european)
778 (icalendar-tests--do-test-import input expected-european))
779 (when expected-american
780 (setq calendar-date-style 'american)
781 (icalendar-tests--do-test-import input expected-american)))))
782 (setenv "TZ" timezone))))
784 (defun icalendar-tests--do-test-import (input expected-output)
785 "Actually perform import test.
786 Argument INPUT input icalendar string.
787 Argument EXPECTED-OUTPUT expected diary string."
788 (let ((temp-file (make-temp-file "icalendar-test-diary")))
789 ;; Test the Catch-the-mysterious-coding-header logic below.
790 ;; Ruby-mode adds an after-save-hook which inserts the header!
792 ;; (find-file temp-file)
794 (icalendar-import-buffer temp-file t t)
796 (find-file temp-file)
797 ;; Check for the mysterious "# coding: ..." header, remove it
799 (goto-char (point-min))
800 (when (re-search-forward "# coding: .*?\n" nil t)
801 (message (concat "%s\n"
802 "Found mysterious \"# coding ...\" header! Removing it.\n"
803 "Current Modes: %s, %s\n"
811 (buffer-disable-undo)
813 (set-buffer-modified-p nil))
815 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
816 (should (string= expected-output result)))
817 (kill-buffer (find-buffer-visiting temp-file))
818 (delete-file temp-file))))
820 (ert-deftest icalendar-import-non-recurring ()
821 "Perform standard import tests."
822 (icalendar-tests--test-import
823 "SUMMARY:non-recurring
824 DTSTART;VALUE=DATE-TIME:20030919T090000
825 DTEND;VALUE=DATE-TIME:20030919T113000"
826 "&2003/9/19 09:00-11:30 non-recurring\n"
827 "&19/9/2003 09:00-11:30 non-recurring\n"
828 "&9/19/2003 09:00-11:30 non-recurring\n")
829 (icalendar-tests--test-import
830 "SUMMARY:non-recurring allday
831 DTSTART;VALUE=DATE-TIME:20030919"
832 "&2003/9/19 non-recurring allday\n"
833 "&19/9/2003 non-recurring allday\n"
834 "&9/19/2003 non-recurring allday\n")
835 (icalendar-tests--test-import
836 ;; Checkdoc removes trailing blanks. Therefore: format!
837 (format "%s\n%s\n%s" "SUMMARY:long " " summary"
838 "DTSTART;VALUE=DATE:20030919")
839 "&2003/9/19 long summary\n"
840 "&19/9/2003 long summary\n"
841 "&9/19/2003 long summary\n")
842 (icalendar-tests--test-import
843 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
847 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
848 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
849 DTSTART;VALUE=DATE:20040719
850 DTEND;VALUE=DATE:20040828
851 DTSTAMP:20031103T011641Z
853 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien
856 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
858 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien
861 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
863 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien
866 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
868 (icalendar-tests--test-import
870 :04979712-3902-11d9-93dd-8f9f4afe08da
877 X-MOZILLA-ALARM-DEFAULT-LENGTH
888 "&2004/11/23 14:00-14:30 folded summary
891 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
892 "&23/11/2004 14:00-14:30 folded summary
895 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
896 "&11/23/2004 14:00-14:30 folded summary
899 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n")
901 (icalendar-tests--test-import
903 :6161a312-3902-11d9-b512-f764153bb28b
910 X-MOZILLA-ALARM-DEFAULT-LENGTH
919 "&2004/11/23 14:45-15:45 another example
922 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
923 "&23/11/2004 14:45-15:45 another example
926 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
927 "&11/23/2004 14:45-15:45 another example
930 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"))
932 (ert-deftest icalendar-import-rrule ()
933 (icalendar-tests--test-import
935 DTSTART;VALUE=DATE-TIME:20030919T090000
936 DTEND;VALUE=DATE-TIME:20030919T113000
939 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily\n"
940 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily\n"
941 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily\n")
943 (icalendar-tests--test-import
945 DTSTART;VALUE=DATE-TIME:20030919T090000
946 DTEND;VALUE=DATE-TIME:20030919T113000
947 RRULE:FREQ=DAILY;INTERVAL=2
949 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily\n"
950 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily\n"
951 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily\n")
952 (icalendar-tests--test-import
953 "SUMMARY:rrule daily with exceptions
954 DTSTART;VALUE=DATE-TIME:20030919T090000
955 DTEND;VALUE=DATE-TIME:20030919T113000
956 RRULE:FREQ=DAILY;INTERVAL=2
957 EXDATE:20030921,20030925
959 "&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions\n"
960 "&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions\n"
961 "&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions\n")
962 (icalendar-tests--test-import
963 "SUMMARY:rrule weekly
964 DTSTART;VALUE=DATE-TIME:20030919T090000
965 DTEND;VALUE=DATE-TIME:20030919T113000
968 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly\n"
969 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly\n"
970 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly\n")
971 (icalendar-tests--test-import
972 "SUMMARY:rrule monthly no end
973 DTSTART;VALUE=DATE-TIME:20030919T090000
974 DTEND;VALUE=DATE-TIME:20030919T113000
977 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end\n"
978 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n"
979 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n")
980 (icalendar-tests--test-import
981 "SUMMARY:rrule monthly with end
982 DTSTART;VALUE=DATE-TIME:20030919T090000
983 DTEND;VALUE=DATE-TIME:20030919T113000
984 RRULE:FREQ=MONTHLY;UNTIL=20050819;
986 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end\n"
987 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end\n"
988 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end\n")
989 (icalendar-tests--test-import
990 "DTSTART;VALUE=DATE:20040815
991 DTEND;VALUE=DATE:20040816
992 SUMMARY:Maria Himmelfahrt
993 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
995 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt\n"
996 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt\n"
997 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt\n")
998 (icalendar-tests--test-import
999 "SUMMARY:rrule yearly
1000 DTSTART;VALUE=DATE-TIME:20030919T090000
1001 DTEND;VALUE=DATE-TIME:20030919T113000
1002 RRULE:FREQ=YEARLY;INTERVAL=2
1004 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly\n" ;FIXME
1005 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly\n" ;FIXME
1006 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly\n") ;FIXME
1007 (icalendar-tests--test-import
1008 "SUMMARY:rrule count daily short
1009 DTSTART;VALUE=DATE-TIME:20030919T090000
1010 DTEND;VALUE=DATE-TIME:20030919T113000
1011 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
1013 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short\n"
1014 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short\n"
1015 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short\n")
1016 (icalendar-tests--test-import
1017 "SUMMARY:rrule count daily long
1018 DTSTART;VALUE=DATE-TIME:20030919T090000
1019 DTEND;VALUE=DATE-TIME:20030919T113000
1020 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
1022 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long\n"
1023 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long\n"
1024 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long\n")
1025 (icalendar-tests--test-import
1026 "SUMMARY:rrule count bi-weekly 3 times
1027 DTSTART;VALUE=DATE-TIME:20030919T090000
1028 DTEND;VALUE=DATE-TIME:20030919T113000
1029 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
1031 "&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times\n"
1032 "&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n"
1033 "&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n")
1034 (icalendar-tests--test-import
1035 "SUMMARY:rrule count monthly
1036 DTSTART;VALUE=DATE-TIME:20030919T090000
1037 DTEND;VALUE=DATE-TIME:20030919T113000
1038 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
1040 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly\n"
1041 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly\n"
1042 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly\n")
1043 (icalendar-tests--test-import
1044 "SUMMARY:rrule count every second month
1045 DTSTART;VALUE=DATE-TIME:20030919T090000
1046 DTEND;VALUE=DATE-TIME:20030919T113000
1047 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
1049 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month\n" ;FIXME
1050 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month\n" ;FIXME
1051 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month\n") ;FIXME
1052 (icalendar-tests--test-import
1053 "SUMMARY:rrule count yearly
1054 DTSTART;VALUE=DATE-TIME:20030919T090000
1055 DTEND;VALUE=DATE-TIME:20030919T113000
1056 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
1058 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly\n"
1059 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly\n"
1060 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly\n")
1061 (icalendar-tests--test-import
1062 "SUMMARY:rrule count every second year
1063 DTSTART;VALUE=DATE-TIME:20030919T090000
1064 DTEND;VALUE=DATE-TIME:20030919T113000
1065 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
1067 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year\n" ;FIXME!!!
1068 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year\n" ;FIXME!!!
1069 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year\n") ;FIXME!!!
1072 (ert-deftest icalendar-import-duration ()
1074 (icalendar-tests--test-import
1075 "DTSTART;VALUE=DATE:20050217
1079 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration\n"
1080 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration\n"
1081 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration\n")
1082 (icalendar-tests--test-import
1083 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
1084 DTSTAMP:20041127T183315Z
1085 LAST-MODIFIED:20041127T183329
1087 DTSTART;VALUE=DATE:20011221
1088 DTEND;VALUE=DATE:20011221
1089 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
1092 CREATED:20041127T183329
1094 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub
1096 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1097 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub
1099 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1100 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub
1102 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"))
1104 (ert-deftest icalendar-import-bug-6766 ()
1105 ;;bug#6766 -- multiple byday values in a weekly rrule
1106 (icalendar-tests--test-import
1108 DTEND;TZID=America/New_York:20100421T120000
1109 DTSTAMP:20100525T141214Z
1110 DTSTART;TZID=America/New_York:20100421T113000
1111 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR
1116 UID:8814e3f9-7482-408f-996c-3bfe486a1262
1120 DTSTAMP:20100525T141214Z
1121 DTSTART;VALUE=DATE:20100422
1122 DTEND;VALUE=DATE:20100423
1123 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH
1125 SUMMARY:Tues + Thurs thinking
1127 UID:8814e3f9-7482-408f-996c-3bfe486a1263
1129 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum
1132 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1133 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking
1135 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1137 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum
1140 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1141 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking
1143 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1145 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum
1148 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1149 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking
1151 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1154 (ert-deftest icalendar-import-multiple-vcalendars ()
1155 (icalendar-tests--test-import
1156 "DTSTART;VALUE=DATE:20110723
1159 "&2011/7/23 event-1\n"
1160 "&23/7/2011 event-1\n"
1161 "&7/23/2011 event-1\n")
1163 (icalendar-tests--test-import
1165 PRODID:-//Emacs//NONSGML icalendar.el//EN
1166 VERSION:2.0\nBEGIN:VEVENT
1167 DTSTART;VALUE=DATE:20110723
1172 PRODID:-//Emacs//NONSGML icalendar.el//EN
1175 DTSTART;VALUE=DATE:20110724
1180 PRODID:-//Emacs//NONSGML icalendar.el//EN
1183 DTSTART;VALUE=DATE:20110725
1187 DTSTART;VALUE=DATE:20110725
1192 "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n"
1193 "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n"
1194 "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n"))
1196 (ert-deftest icalendar-import-with-uid ()
1197 "Perform import test with uid."
1198 (icalendar-tests--test-import
1200 SUMMARY:non-recurring
1201 DTSTART;VALUE=DATE-TIME:20030919T090000
1202 DTEND;VALUE=DATE-TIME:20030919T113000"
1203 "&2003/9/19 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1204 "&19/9/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1205 "&9/19/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"))
1207 (ert-deftest icalendar-import-with-timezone ()
1209 (icalendar-tests--test-import
1212 TZID:fictional\, nonexistent\, arbitrary
1214 DTSTART:20100101T000000
1217 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01
1220 DTSTART:20101201T000000
1223 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
1227 SUMMARY:standardtime
1228 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000
1229 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000
1232 SUMMARY:daylightsavingtime
1233 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000
1234 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000
1237 ;; "standardtime" begins first sunday in january and is 4 hours behind CET
1238 ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET
1239 "&2012/1/15 15:00-15:30 standardtime
1240 &2012/12/15 11:00-11:30 daylightsavingtime
1245 ;; ======================================================================
1247 ;; ======================================================================
1248 (defun icalendar-tests--test-cycle (input)
1249 "Perform cycle test.
1250 Argument INPUT icalendar event string."
1252 (if (string-match "^BEGIN:VCALENDAR" input)
1254 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1255 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1257 (unless (eq (char-before) ?\n)
1259 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1260 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
1261 (icalendar-import-format-summary "%s")
1262 (icalendar-import-format-location "\n Location: %s")
1263 (icalendar-import-format-description "\n Desc: %s")
1264 (icalendar-import-format-organizer "\n Organizer: %s")
1265 (icalendar-import-format-status "\n Status: %s")
1266 (icalendar-import-format-url "\n URL: %s")
1267 (icalendar-import-format-class "\n Class: %s")
1268 (icalendar-import-format-class "\n UID: %s"))
1269 (dolist (calendar-date-style '(iso european american))
1270 (icalendar-tests--do-test-cycle)))))
1272 (defun icalendar-tests--do-test-cycle ()
1273 "Actually perform import/export cycle test."
1274 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1275 (temp-ics (make-temp-file "icalendar-test-ics"))
1276 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1281 (icalendar-import-buffer temp-diary t t)
1283 ;; step 2: export what was just imported
1285 (find-file temp-diary)
1286 (icalendar-export-region (point-min) (point-max) temp-ics))
1288 ;; compare the output of step 2 with the input of step 1
1290 (find-file temp-ics)
1291 (goto-char (point-min))
1292 ;;(when (re-search-forward "\nUID:.*\n" nil t)
1293 ;;(replace-match "\n"))
1294 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1295 (should (string= org-input cycled)))))
1297 (kill-buffer (find-buffer-visiting temp-diary))
1298 (with-current-buffer (find-buffer-visiting temp-ics)
1299 (set-buffer-modified-p nil)
1300 (kill-buffer (current-buffer)))
1301 (delete-file temp-diary)
1302 (delete-file temp-ics))))
1304 (ert-deftest icalendar-cycle ()
1305 "Perform cycling tests.
1306 Take care to avoid auto-generated UIDs here."
1307 (icalendar-tests--test-cycle
1309 DTSTART;VALUE=DATE-TIME:20030919T090000
1310 DTEND;VALUE=DATE-TIME:20030919T113000
1313 (icalendar-tests--test-cycle
1315 DTSTART;VALUE=DATE-TIME:20030919T090000
1316 DTEND;VALUE=DATE-TIME:20030919T113000
1318 DESCRIPTION:beschreibung!
1322 (icalendar-tests--test-cycle
1324 DTSTART;VALUE=DATE:19190909
1325 DTEND;VALUE=DATE:19190910
1326 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1327 SUMMARY:and diary-anniversary
1330 ;; ======================================================================
1332 ;; ======================================================================
1333 (ert-deftest icalendar-real-world ()
1334 "Perform real-world tests, as gathered from problem reports."
1336 (icalendar-tests--test-import
1339 PRODID:Microsoft CDO for Microsoft Exchange
1342 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
1343 X-MICROSOFT-CDO-TZID:23
1345 DTSTART:16010101T000000
1350 DTSTART:16010101T000000
1356 DTSTAMP:20030509T043439Z
1357 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1358 SUMMARY:On-Site Interview
1359 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1360 010000000DB823520692542408ED02D7023F9DFF9
1361 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1362 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1363 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1364 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1365 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1366 zz\":MAILTO:zzzzzz@zzzzzzz.com
1367 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1369 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1370 DESCRIPTION:10:30am - Blah
1374 CREATED:20030509T043439Z
1375 LAST-MODIFIED:20030509T043459Z
1378 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1379 X-MICROSOFT-CDO-INSTTYPE:0
1380 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1381 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1382 X-MICROSOFT-CDO-IMPORTANCE:1
1383 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1386 DESCRIPTION:REMINDER
1387 TRIGGER;RELATED=START:-PT00H15M00S
1392 "&9/5/2003 10:30-15:30 On-Site Interview
1393 Desc: 10:30am - Blah
1395 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1397 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1399 "&5/9/2003 10:30-15:30 On-Site Interview
1400 Desc: 10:30am - Blah
1402 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1404 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1408 (icalendar-tests--test-import
1409 "DTSTAMP:20030618T195512Z
1410 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1411 SUMMARY:Dress Rehearsal for XXXX-XXXX
1412 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1413 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1414 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1415 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1416 ORGANIZER;CN=\"ABCD,TECHTRAINING
1417 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1418 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1419 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1420 DESCRIPTION:753 Zeichen hier radiert
1424 CREATED:20030618T195518Z
1425 LAST-MODIFIED:20030618T195527Z
1428 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1429 X-MICROSOFT-CDO-INSTTYPE:0
1430 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1431 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1432 X-MICROSOFT-CDO-IMPORTANCE:1
1433 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1436 DESCRIPTION:REMINDER
1437 TRIGGER;RELATED=START:-PT00H15M00S
1440 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1441 Desc: 753 Zeichen hier radiert
1442 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1443 Organizer: MAILTO:xxx@xxxxx.com
1445 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1447 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1448 Desc: 753 Zeichen hier radiert
1449 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1450 Organizer: MAILTO:xxx@xxxxx.com
1452 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1454 ;; 2003-06-18 b -- uses timezone
1455 (icalendar-tests--test-import
1458 PRODID:Microsoft CDO for Microsoft Exchange
1461 TZID:Mountain Time (US & Canada)
1462 X-MICROSOFT-CDO-TZID:12
1464 DTSTART:16010101T020000
1467 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1470 DTSTART:16010101T020000
1473 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1477 DTSTAMP:20030618T230323Z
1478 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1479 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1480 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1481 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1482 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1483 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1484 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1486 ORGANIZER;CN=\"ABCD,TECHTRAINING
1487 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1488 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1489 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1490 DESCRIPTION:Viele Zeichen standen hier früher
1494 CREATED:20030618T230326Z
1495 LAST-MODIFIED:20030618T230335Z
1498 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1499 X-MICROSOFT-CDO-INSTTYPE:0
1500 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1501 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1502 X-MICROSOFT-CDO-IMPORTANCE:1
1503 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1506 DESCRIPTION:REMINDER
1507 TRIGGER;RELATED=START:-PT00H15M00S
1512 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1513 Desc: Viele Zeichen standen hier früher
1514 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1515 Organizer: MAILTO:bbb@bbbbb.com
1517 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1519 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1520 Desc: Viele Zeichen standen hier früher
1521 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1522 Organizer: MAILTO:bbb@bbbbb.com
1524 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1526 ;; export 2004-10-28 block entries
1527 (icalendar-tests--test-export
1530 "-*- mode: text; fill-column: 256;-*-
1534 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1536 "DTSTART;VALUE=DATE:20041108
1537 DTEND;VALUE=DATE:20041111
1538 SUMMARY:Nov 8-10 aa")
1540 (icalendar-tests--test-export
1543 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1544 "DTSTART;VALUE=DATE:20041213
1545 DTEND;VALUE=DATE:20041218
1546 SUMMARY:Dec 13-17 bb")
1548 (icalendar-tests--test-export
1551 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1552 "DTSTART;VALUE=DATE:20050203
1553 DTEND;VALUE=DATE:20050205
1554 SUMMARY:Feb 3-4 cc")
1556 (icalendar-tests--test-export
1559 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1560 "DTSTART;VALUE=DATE:20050424
1561 DTEND;VALUE=DATE:20050430
1562 SUMMARY:April 24-29 dd
1564 (icalendar-tests--test-export
1567 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1568 "DTSTART;VALUE=DATE:20050530
1569 DTEND;VALUE=DATE:20050602
1570 SUMMARY:may 30 - June 1: ee")
1572 (icalendar-tests--test-export
1575 "%%(diary-block 6 6 2005 6 8 2005) ff"
1576 "DTSTART;VALUE=DATE:20050606
1577 DTEND;VALUE=DATE:20050609
1580 ;; export 2004-10-28 anniversary entries
1581 (icalendar-tests--test-export
1587 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1588 "DTSTART;VALUE=DATE:19910328
1589 DTEND;VALUE=DATE:19910329
1590 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1591 SUMMARY:aa birthday (%d years old)
1594 (icalendar-tests--test-export
1597 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1598 "DTSTART;VALUE=DATE:19570517
1599 DTEND;VALUE=DATE:19570518
1600 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1601 SUMMARY:bb birthday (%d years old)")
1603 (icalendar-tests--test-export
1606 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1607 "DTSTART;VALUE=DATE:19970608
1608 DTEND;VALUE=DATE:19970609
1609 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1610 SUMMARY:cc birthday (%d years old)")
1612 (icalendar-tests--test-export
1615 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1616 "DTSTART;VALUE=DATE:19830722
1617 DTEND;VALUE=DATE:19830723
1618 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1619 SUMMARY:dd (%d years ago...!)")
1621 (icalendar-tests--test-export
1624 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1625 "DTSTART;VALUE=DATE:19880801
1626 DTEND;VALUE=DATE:19880802
1627 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1628 SUMMARY:ee birthday (%d years old)")
1630 (icalendar-tests--test-export
1633 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1634 "DTSTART;VALUE=DATE:19570921
1635 DTEND;VALUE=DATE:19570922
1636 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1637 SUMMARY:ff birthday (%d years old)")
1642 ;; export 2004-10-28 monthly, weekly entries
1644 ;; (icalendar-tests--test-export
1647 ;; >>> ------------ monthly:
1649 ;; */27/* 10:00 blah blah"
1652 (icalendar-tests--test-export
1655 ">>> ------------ my week:
1658 "DTSTART;VALUE=DATE-TIME:20000103T130000
1659 DTEND;VALUE=DATE-TIME:20000103T140000
1660 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1663 (icalendar-tests--test-export
1667 "DTSTART;VALUE=DATE-TIME:20000103T150000
1668 DTEND;VALUE=DATE-TIME:20000103T160000
1669 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1673 (icalendar-tests--test-export
1676 "Monday 16:00-17:00 a2"
1677 "DTSTART;VALUE=DATE-TIME:20000103T160000
1678 DTEND;VALUE=DATE-TIME:20000103T170000
1679 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1682 (icalendar-tests--test-export
1685 "Tuesday 11:30-13:00 a3"
1686 "DTSTART;VALUE=DATE-TIME:20000104T113000
1687 DTEND;VALUE=DATE-TIME:20000104T130000
1688 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1691 (icalendar-tests--test-export
1695 "DTSTART;VALUE=DATE-TIME:20000104T150000
1696 DTEND;VALUE=DATE-TIME:20000104T160000
1697 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1700 (icalendar-tests--test-export
1703 "Wednesday 13:00 a5"
1704 "DTSTART;VALUE=DATE-TIME:20000105T130000
1705 DTEND;VALUE=DATE-TIME:20000105T140000
1706 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1709 (icalendar-tests--test-export
1712 "Wednesday 11:30-13:30 a6"
1713 "DTSTART;VALUE=DATE-TIME:20000105T113000
1714 DTEND;VALUE=DATE-TIME:20000105T133000
1715 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1718 (icalendar-tests--test-export
1721 "Wednesday 15:00 s1"
1722 "DTSTART;VALUE=DATE-TIME:20000105T150000
1723 DTEND;VALUE=DATE-TIME:20000105T160000
1724 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1728 ;; export 2004-10-28 regular entries
1729 (icalendar-tests--test-export
1733 >>> regular diary entries:
1735 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1736 "DTSTART;VALUE=DATE-TIME:20041012T140000
1737 DTEND;VALUE=DATE-TIME:20041012T150000
1738 SUMMARY:Tue: [2004-10-12] q1")
1741 (icalendar-tests--test-import
1746 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1754 X-MOZILLA-ALARM-DEFAULT-LENGTH
1772 X-MOZILLA-ALARM-DEFAULT-LENGTH
1788 X-MOZILLA-ALARM-DEFAULT-LENGTH
1804 X-MOZILLA-ALARM-DEFAULT-LENGTH
1806 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1809 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1819 :Rrrr/Cccccc ii Aaaaaaaa
1821 :Vvvvv Rrrr aaa Cccccc
1826 X-MOZILLA-ALARM-DEFAULT-LENGTH
1846 X-MOZILLA-ALARM-DEFAULT-LENGTH
1849 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1864 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1867 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1870 &23/11/2004 11:00-12:00 Hhhhhhhh
1873 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1876 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1877 Desc: Vvvvv Rrrr aaa Cccccc
1880 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1884 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1887 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1890 &11/23/2004 11:00-12:00 Hhhhhhhh
1893 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1896 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1897 Desc: Vvvvv Rrrr aaa Cccccc
1900 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1906 (icalendar-tests--test-export
1907 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1910 "DTSTART;VALUE=DATE:20040101
1911 DTEND;VALUE=DATE:20040105
1915 (icalendar-tests--test-export
1917 "5 11 2004 Bla Fasel"
1919 "DTSTART;VALUE=DATE:20041105
1920 DTEND;VALUE=DATE:20041106
1924 (icalendar-tests--test-export
1926 "2 Nov 2004 15:00-16:30 Zahnarzt"
1928 "DTSTART;VALUE=DATE-TIME:20041102T150000
1929 DTEND;VALUE=DATE-TIME:20041102T163000
1933 (icalendar-tests--test-import
1935 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1955 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1959 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
1961 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1965 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
1969 (icalendar-tests--test-import
1970 "DTSTART;VALUE=DATE:20050217
1971 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1972 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1973 DTSTAMP:20050118T210335Z
1976 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
1977 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n"
1978 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
1979 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n")
1982 (icalendar-tests--test-export
1984 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1986 "DTSTART;VALUE=DATE-TIME:20050208T160000
1987 DTEND;VALUE=DATE-TIME:20050208T164500
1988 RRULE:FREQ=DAILY;INTERVAL=7
1993 (icalendar-tests--test-export
1996 ;; FIXME: colon not allowed!
1997 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1998 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1999 "DTSTART;VALUE=DATE:19001101
2000 DTEND;VALUE=DATE:19001102
2001 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
2002 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
2006 (icalendar-tests--test-import
2009 PRODID:Microsoft Exchange Server 2007
2012 TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna
2014 DTSTART:16010101T030000
2017 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
2020 DTSTART:16010101T020000
2023 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
2027 ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com
2028 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth
2029 er\":MAILTO:other.luser@foo.com
2030 DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n
2031 SUMMARY;LANGUAGE=en-US:Query
2032 DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\"
2034 DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2
2036 UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000
2037 010000000575268034ECDB649A15349B1BF240F15
2038 RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V
2039 ienna\":20120515T170000
2042 DTSTAMP:20120514T153645Z
2046 LOCATION;LANGUAGE=en-US:phone
2047 X-MICROSOFT-CDO-APPT-SEQUENCE:15
2048 X-MICROSOFT-CDO-OWNERAPPTID:1907632092
2049 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
2050 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
2051 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
2052 X-MICROSOFT-CDO-IMPORTANCE:1
2053 X-MICROSOFT-CDO-INSTTYPE:3
2056 DESCRIPTION:REMINDER
2057 TRIGGER;RELATED=START:-PT15M
2062 "&15/5/2012 15:00-15:30 Query
2064 Organizer: MAILTO:a.luser@foo.com
2067 UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15
2071 (provide 'icalendar-tests)
2072 ;;; icalendar-tests.el ends here