1 ;; icalendar-tests.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008-2011 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 (defun icalendar-tests--compare-strings (str1 str2
)
55 "Compare strings STR1 and STR2.
56 Return t if strings are equal, else return substring indicating first difference.
57 FIXME: make this a little smarter."
58 (let* ((s1 (icalendar-tests--trim str1
))
59 (s2 (icalendar-tests--trim str2
))
60 (result (compare-strings s1
0 nil s2
0 nil
))
64 (concat "..." (substring str2
(- result
1)
65 (min len
(+ (- result
1) 3))) "...")
66 (concat "..." (substring str2
(- (+ result
1))
67 (min len
(+ (- (+ result
1)) 3))) "..."))
70 (ert-deftest icalendar-tests--compare-strings
()
71 "Test icalendar-tests--compare-strings."
72 (should (equal t
(icalendar-tests--compare-strings " abcde" "abcde ")))
75 (icalendar-tests--compare-strings "abcxe" "abcdefghijklmn")))
76 (should (string= "...xe..."
77 (icalendar-tests--compare-strings "abcde" "abcxe")))
78 (should (string= "...ddd..."
79 (icalendar-tests--compare-strings "abc" "abcdddddd")))
80 (should (string= "......"
81 (icalendar-tests--compare-strings "abcdefghij" "abc"))))
83 ;; ======================================================================
85 ;; ======================================================================
87 (ert-deftest icalendar--create-uid
()
88 "Test for `icalendar--create-uid'."
89 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
91 (icalendar--uid-count 77)
92 (entry-full "30.06.1964 07:01 blahblah")
93 (hash (format "%d" (abs (sxhash entry-full
))))
94 (contents "DTSTART:19640630T070100\nblahblah")
95 (username (or user-login-name
"UNKNOWN_USER"))
97 (fset 't-ct
(symbol-function 'current-time
))
100 (fset 'current-time
(lambda () '(1 2 3)))
101 (should (= 77 icalendar--uid-count
))
102 (should (string= (concat "xxx-123-77-" hash
"-" username
"-19640630")
103 (icalendar--create-uid entry-full contents
)))
104 (should (= 78 icalendar--uid-count
)))
105 ;; restore 'current-time
106 (fset 'current-time
(symbol-function 't-ct
)))
107 (setq contents
"blahblah")
108 (setq icalendar-uid-format
"yyy%syyy")
109 (should (string= (concat "yyyDTSTARTyyy")
110 (icalendar--create-uid entry-full contents
)))))
112 (ert-deftest icalendar--calendar-style
()
113 "Test for `icalendar--date-style'."
114 (dolist (calendar-date-style '(iso american european
))
115 (should (eq (icalendar--date-style) calendar-date-style
)))
116 (let ((cds calendar-date-style
)
117 (european-calendar-style t
))
118 (makunbound 'calendar-date-style
)
119 (should (eq (icalendar--date-style) 'european
))
120 (with-no-warnings (setq european-calendar-style nil
)) ;still get warning!?! FIXME
121 (should (eq (icalendar--date-style) 'american
))
122 (setq calendar-date-style cds
)))
124 (ert-deftest icalendar-convert-anniversary-to-ical
()
125 "Test method for `icalendar--convert-anniversary-to-ical'."
126 (let* ((calendar-date-style 'iso
)
128 (setq result
(icalendar--convert-anniversary-to-ical
129 "" "%%(diary-anniversary 1964 6 30) g"))
130 (should (= 2 (length result
)))
131 (should (string= (concat
132 "\nDTSTART;VALUE=DATE:19640630"
133 "\nDTEND;VALUE=DATE:19640701"
134 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=30")
136 (should (string= "g" (cadr result
)))))
138 (ert-deftest icalendar--convert-cyclic-to-ical
()
139 "Test method for `icalendar--convert-cyclic-to-ical'."
140 (let* ((calendar-date-style 'iso
)
142 (setq result
(icalendar--convert-block-to-ical
143 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
144 (should (= 2 (length result
)))
145 (should (string= (concat
146 "\nDTSTART;VALUE=DATE:20040719"
147 "\nDTEND;VALUE=DATE:20040828")
149 (should (string= "Sommerferien" (cadr result
)))))
151 (ert-deftest icalendar--convert-block-to-ical
()
152 "Test method for `icalendar--convert-block-to-ical'."
153 (let* ((calendar-date-style 'iso
)
155 (setq result
(icalendar--convert-block-to-ical
156 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
157 (should (= 2 (length result
)))
158 (should (string= (concat
159 "\nDTSTART;VALUE=DATE:20040719"
160 "\nDTEND;VALUE=DATE:20040828")
162 (should (string= "Sommerferien" (cadr result
)))))
164 (ert-deftest icalendar--convert-yearly-to-ical
()
165 "Test method for `icalendar--convert-yearly-to-ical'."
166 (let* ((calendar-date-style 'iso
)
168 (calendar-month-name-array
169 ["January" "February" "March" "April" "May" "June" "July" "August"
170 "September" "October" "November" "December"]))
171 (setq result
(icalendar--convert-yearly-to-ical "" "May 1 Tag der Arbeit"))
172 (should (= 2 (length result
)))
173 (should (string= (concat
174 "\nDTSTART;VALUE=DATE:19000501"
175 "\nDTEND;VALUE=DATE:19000502"
176 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1")
178 (should (string= "Tag der Arbeit" (cadr result
)))))
180 (ert-deftest icalendar--convert-weekly-to-ical
()
181 "Test method for `icalendar--convert-weekly-to-ical'."
182 (let* ((calendar-date-style 'iso
)
184 (calendar-day-name-array
185 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
187 (setq result
(icalendar--convert-weekly-to-ical "" "Monday 8:30 subject"))
188 (should (= 2 (length result
)))
189 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20050103T083000"
190 "\nDTEND;VALUE=DATE-TIME:20050103T093000"
191 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO")
193 (should (string= "subject" (cadr result
)))))
195 (ert-deftest icalendar--parse-vtimezone
()
196 "Test method for `icalendar--parse-vtimezone'."
197 (let (vtimezone result
)
198 (setq vtimezone
(icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
201 DTSTART:16010101T040000
204 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
207 DTSTART:16010101T030000
210 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
214 (setq result
(icalendar--parse-vtimezone vtimezone
))
215 (should (string= "thename" (car result
)))
216 (message (cdr result
))
217 (should (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00"
219 (setq vtimezone
(icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
222 DTSTART:16010101T040000
225 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
228 DTSTART:16010101T030000
231 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
235 (setq result
(icalendar--parse-vtimezone vtimezone
))
236 (should (string= "anothername" (car result
)))
237 (message (cdr result
))
238 (should (string= "STD-02:00DST-03:00,M3.2.1/03:00:00,M10.2.1/04:00:00"
241 (ert-deftest icalendar--convert-ordinary-to-ical
()
242 "Test method for `icalendar--convert-ordinary-to-ical'."
243 (let* ((calendar-date-style 'iso
)
246 (setq result
(icalendar--convert-ordinary-to-ical "&?" "2010 2 15 subject"))
247 (should (= 2 (length result
)))
248 (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216"
250 (should (string= "subject" (cadr result
)))
253 (setq result
(icalendar--convert-ordinary-to-ical
254 "&?" "&2010 2 15 12:34-23:45 s"))
255 (should (= 2 (length result
)))
256 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
257 "\nDTEND;VALUE=DATE-TIME:20100215T234500")
259 (should (string= "s" (cadr result
)))
261 ;; with time, again -- test bug#5549
262 (setq result
(icalendar--convert-ordinary-to-ical
263 "x?" "x2010 2 15 0:34-1:45 s"))
264 (should (= 2 (length result
)))
265 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400"
266 "\nDTEND;VALUE=DATE-TIME:20100215T014500")
268 (should (string= "s" (cadr result
)))))
270 (ert-deftest icalendar--diarytime-to-isotime
()
271 "Test method for `icalendar--diarytime-to-isotime'."
272 (should (string= (icalendar--diarytime-to-isotime "01:15" "")
274 (should (string= (icalendar--diarytime-to-isotime "1:15" "")
276 (should (string= (icalendar--diarytime-to-isotime "0:01" "")
278 (should (string= (icalendar--diarytime-to-isotime "0100" "")
280 (should (string= (icalendar--diarytime-to-isotime "0100" "am")
282 (should (string= (icalendar--diarytime-to-isotime "0100" "pm")
284 (should (string= (icalendar--diarytime-to-isotime "1200" "")
286 (should (string= (icalendar--diarytime-to-isotime "17:17" "")
288 (should (string= (icalendar--diarytime-to-isotime "1200" "am")
290 (should (string= (icalendar--diarytime-to-isotime "1201" "am")
292 (should (string= (icalendar--diarytime-to-isotime "1259" "am")
294 (should (string= (icalendar--diarytime-to-isotime "1200" "pm")
296 (should (string= (icalendar--diarytime-to-isotime "1201" "pm")
298 (should (string= (icalendar--diarytime-to-isotime "1259" "pm")
301 (ert-deftest icalendar--datetime-to-diary-date
()
302 "Test method for `icalendar--datetime-to-diary-date'."
303 (let* ((datetime '(59 59 23 31 12 2008))
304 (calendar-date-style 'iso
))
305 (should (string= (icalendar--datetime-to-diary-date datetime
)
307 (setq calendar-date-style
'european
)
308 (should (string= (icalendar--datetime-to-diary-date datetime
)
310 (setq calendar-date-style
'american
)
311 (should (string= (icalendar--datetime-to-diary-date datetime
)
314 (ert-deftest icalendar--datestring-to-isodate
()
315 "Test method for `icalendar--datestring-to-isodate'."
316 (let ((calendar-date-style 'iso
))
318 (should (string= (icalendar--datestring-to-isodate "2008 05 11")
320 (should (string= (icalendar--datestring-to-isodate "2008 05 31")
322 (should (string= (icalendar--datestring-to-isodate "2008 05 31" 2)
326 (setq calendar-date-style
'european
)
327 (should (string= (icalendar--datestring-to-isodate "11 05 2008")
329 (should (string= (icalendar--datestring-to-isodate "31 05 2008")
331 (should (string= (icalendar--datestring-to-isodate "31 05 2008" 2)
335 (setq calendar-date-style
'american
)
336 (should (string= (icalendar--datestring-to-isodate "11 05 2008")
338 (should (string= (icalendar--datestring-to-isodate "12 30 2008")
340 (should (string= (icalendar--datestring-to-isodate "12 30 2008" 2)
344 (setq calendar-date-style nil
) ;not necessary for conversion
345 (should (string= (icalendar--datestring-to-isodate "Nov 05 2008")
347 (should (string= (icalendar--datestring-to-isodate "05 Nov 2008")
349 (should (string= (icalendar--datestring-to-isodate "2008 Nov 05")
352 (ert-deftest icalendar--first-weekday-of-year
()
353 "Test method for `icalendar-first-weekday-of-year'."
354 (should (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
355 (should (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
356 (should (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
357 (should (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
358 (should (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
359 (should (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
360 (should (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
361 (should (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
362 (should (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
364 (ert-deftest icalendar--import-format-sample
()
365 "Test method for `icalendar-import-format-sample'."
366 (should (string= (icalendar-import-format-sample
367 (icalendar-tests--get-ical-event "BEGIN:VEVENT
368 DTSTAMP:20030509T043439Z
369 DTSTART:20030509T103000
373 DTEND:20030509T153000
377 (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
378 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'"))))
380 (ert-deftest icalendar--format-ical-event
()
381 "Test `icalendar--format-ical-event'."
382 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
383 (icalendar-import-format-summary "SUM %s")
384 (icalendar-import-format-location " LOC %s")
385 (icalendar-import-format-description " DES %s")
386 (icalendar-import-format-organizer " ORG %s")
387 (icalendar-import-format-status " STA %s")
388 (icalendar-import-format-url " URL %s")
389 (icalendar-import-format-class " CLA %s")
390 (event (icalendar-tests--get-ical-event "BEGIN:VEVENT
391 DTSTAMP:20030509T043439Z
392 DTSTART:20030509T103000
396 DTEND:20030509T153000
400 (should (string= (icalendar--format-ical-event event
)
401 "SUM sum DES des LOC loc ORG org"))
402 (setq icalendar-import-format
(lambda (&rest ignore
)
404 (should (string= (icalendar--format-ical-event event
)
406 (setq icalendar-import-format
408 (format "-%s-%s-%s-%s-%s-%s-%s-"
409 (icalendar--get-event-property event
'SUMMARY
)
410 (icalendar--get-event-property event
'DESCRIPTION
)
411 (icalendar--get-event-property event
'LOCATION
)
412 (icalendar--get-event-property event
'ORGANIZER
)
413 (icalendar--get-event-property event
'STATUS
)
414 (icalendar--get-event-property event
'URL
)
415 (icalendar--get-event-property event
'CLASS
))))
416 (should (string= (icalendar--format-ical-event event
)
417 "-sum-des-loc-org-nil-nil-nil-"))))
419 (ert-deftest icalendar--parse-summary-and-rest
()
420 "Test `icalendar--parse-summary-and-rest'."
421 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
422 (icalendar-import-format-summary "SUM %s")
423 (icalendar-import-format-location " LOC %s")
424 (icalendar-import-format-description " DES %s")
425 (icalendar-import-format-organizer " ORG %s")
426 (icalendar-import-format-status " STA %s")
427 (icalendar-import-format-url " URL %s")
428 (icalendar-import-format-class " CLA %s")
430 (setq result
(icalendar--parse-summary-and-rest "SUM sum ORG org"))
431 (should (string= (cdr (assoc 'org result
)) "org"))
433 (setq result
(icalendar--parse-summary-and-rest
434 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
435 (should (string= (cdr (assoc 'des result
)) "des"))
436 (should (string= (cdr (assoc 'loc result
)) "loc"))
437 (should (string= (cdr (assoc 'org result
)) "org"))
438 (should (string= (cdr (assoc 'sta result
)) "sta"))
439 (should (string= (cdr (assoc 'cla result
)) "cla"))
441 (setq icalendar-import-format
(lambda () "Hello world"))
442 (setq result
(icalendar--parse-summary-and-rest
444 (should (not result
))
447 ;; ======================================================================
449 ;; ======================================================================
451 (defun icalendar-tests--test-export (input-iso input-european input-american
453 "Perform an export test.
454 Argument INPUT-ISO iso style diary string.
455 Argument INPUT-EUROPEAN european style diary string.
456 Argument INPUT-AMERICAN american style diary string.
457 Argument EXPECTED-OUTPUT expected icalendar result string.
459 European style input data must use german month names. American
460 and ISO style input data must use english month names."
461 (let ((tz (cadr (current-time-zone)))
462 (calendar-date-style 'iso
)
463 (icalendar-recurring-start-year 2000))
466 (set-time-zone-rule "CET")
468 (let ((calendar-month-name-array
469 ["January" "February" "March" "April" "May" "June" "July" "August"
470 "September" "October" "November" "December"])
471 (calendar-day-name-array
472 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
474 (setq calendar-date-style
'iso
)
475 (icalendar-tests--do-test-export input-iso expected-output
)))
477 (let ((calendar-month-name-array
478 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
479 "September" "Oktober" "November" "Dezember"])
480 (calendar-day-name-array
481 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
483 (setq calendar-date-style
'european
)
484 (icalendar-tests--do-test-export input-european expected-output
)))
486 (let ((calendar-month-name-array
487 ["January" "February" "March" "April" "May" "June" "July" "August"
488 "September" "October" "November" "December"])
489 (calendar-day-name-array
490 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
492 (setq calendar-date-style
'american
)
493 (icalendar-tests--do-test-export input-american expected-output
))))
494 ;; restore time-zone if something went terribly wrong
495 (set-time-zone-rule tz
))))
497 (defun icalendar-tests--do-test-export (input expected-output
)
498 "Actually perform export test.
499 Argument INPUT input diary string.
500 Argument EXPECTED-OUTPUT expected icalendar result string."
501 (let ((temp-file (make-temp-file "icalendar-tests-ics")))
506 (icalendar-export-region (point-min) (point-max) temp-file
))
508 (find-file temp-file
)
509 (goto-char (point-min))
510 (cond (expected-output
511 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
512 PRODID:-//Emacs//NONSGML icalendar.el//EN
521 (should (string-match
523 (regexp-quote (buffer-substring-no-properties
524 (match-beginning 1) (match-end 1)))
528 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
529 PRODID:-//Emacs//NONSGML icalendar.el//EN
535 (kill-buffer (find-buffer-visiting temp-file
))
536 (delete-file temp-file
))))
538 (ert-deftest icalendar-export-ordinary-no-time
()
539 "Perform export test."
541 (let ((icalendar-export-hidden-diary-entries nil
))
542 (icalendar-tests--test-export
543 "&2000 Oct 3 ordinary no time "
544 "&3 Okt 2000 ordinary no time "
545 "&Oct 3 2000 ordinary no time "
548 (icalendar-tests--test-export
549 "2000 Oct 3 ordinary no time "
550 "3 Okt 2000 ordinary no time "
551 "Oct 3 2000 ordinary no time "
552 "DTSTART;VALUE=DATE:20001003
553 DTEND;VALUE=DATE:20001004
554 SUMMARY:ordinary no time
557 (ert-deftest icalendar-export-ordinary
()
558 "Perform export test."
560 (icalendar-tests--test-export
561 "2000 Oct 3 16:30 ordinary with time"
562 "3 Okt 2000 16:30 ordinary with time"
563 "Oct 3 2000 16:30 ordinary with time"
564 "DTSTART;VALUE=DATE-TIME:20001003T163000
565 DTEND;VALUE=DATE-TIME:20001003T173000
566 SUMMARY:ordinary with time
568 (icalendar-tests--test-export
569 "2000 10 3 16:30 ordinary with time 2"
570 "3 10 2000 16:30 ordinary with time 2"
571 "10 3 2000 16:30 ordinary with time 2"
572 "DTSTART;VALUE=DATE-TIME:20001003T163000
573 DTEND;VALUE=DATE-TIME:20001003T173000
574 SUMMARY:ordinary with time 2
577 (icalendar-tests--test-export
578 "2000/10/3 16:30 ordinary with time 3"
579 "3/10/2000 16:30 ordinary with time 3"
580 "10/3/2000 16:30 ordinary with time 3"
581 "DTSTART;VALUE=DATE-TIME:20001003T163000
582 DTEND;VALUE=DATE-TIME:20001003T173000
583 SUMMARY:ordinary with time 3
586 (ert-deftest icalendar-export-multiline
()
587 "Perform export test."
589 ;; multiline -- FIXME!!!
590 (icalendar-tests--test-export
591 "2000 October 3 16:30 multiline
592 17:30 multiline continued FIXME"
593 "3 Oktober 2000 16:30 multiline
594 17:30 multiline continued FIXME"
595 "October 3 2000 16:30 multiline
596 17:30 multiline continued FIXME"
597 "DTSTART;VALUE=DATE-TIME:20001003T163000
598 DTEND;VALUE=DATE-TIME:20001003T173000
601 17:30 multiline continued FIXME
604 (ert-deftest icalendar-export-weekly-by-day
()
605 "Perform export test."
608 (icalendar-tests--test-export
609 "Monday 1:30pm weekly by day with start time"
610 "Montag 13:30 weekly by day with start time"
611 "Monday 1:30pm weekly by day with start time"
612 "DTSTART;VALUE=DATE-TIME:20000103T133000
613 DTEND;VALUE=DATE-TIME:20000103T143000
614 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
615 SUMMARY:weekly by day with start time
618 (icalendar-tests--test-export
619 "Monday 13:30-15:00 weekly by day with start and end time"
620 "Montag 13:30-15:00 weekly by day with start and end time"
621 "Monday 01:30pm-03:00pm weekly by day with start and end time"
622 "DTSTART;VALUE=DATE-TIME:20000103T133000
623 DTEND;VALUE=DATE-TIME:20000103T150000
624 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
625 SUMMARY:weekly by day with start and end time
628 (ert-deftest icalendar-export-yearly
()
629 "Perform export test."
631 (icalendar-tests--test-export
632 "may 1 yearly no time"
633 "1 Mai yearly no time"
634 "may 1 yearly no time"
635 "DTSTART;VALUE=DATE:19000501
636 DTEND;VALUE=DATE:19000502
637 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
638 SUMMARY:yearly no time
641 (ert-deftest icalendar-export-anniversary
()
642 "Perform export test."
644 (icalendar-tests--test-export
645 "%%(diary-anniversary 1989 10 3) anniversary no time"
646 "%%(diary-anniversary 3 10 1989) anniversary no time"
647 "%%(diary-anniversary 10 3 1989) anniversary no time"
648 "DTSTART;VALUE=DATE:19891003
649 DTEND;VALUE=DATE:19891004
650 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
651 SUMMARY:anniversary no time
653 (icalendar-tests--test-export
654 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
655 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
656 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
657 "DTSTART;VALUE=DATE-TIME:19891003T190000
658 DTEND;VALUE=DATE-TIME:19891004T200000
659 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
660 SUMMARY:anniversary with time
663 (ert-deftest icalendar-export-block
()
664 "Perform export test."
666 (icalendar-tests--test-export
667 "%%(diary-block 2001 6 18 2001 7 6) block no time"
668 "%%(diary-block 18 6 2001 6 7 2001) block no time"
669 "%%(diary-block 6 18 2001 7 6 2001) block no time"
670 "DTSTART;VALUE=DATE:20010618
671 DTEND;VALUE=DATE:20010707
672 SUMMARY:block no time
674 (icalendar-tests--test-export
675 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
676 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
677 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
678 "DTSTART;VALUE=DATE-TIME:20010618T130000
679 DTEND;VALUE=DATE-TIME:20010618T170000
680 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
681 SUMMARY:block with time
683 (icalendar-tests--test-export
684 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
685 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
686 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
687 "DTSTART;VALUE=DATE-TIME:20010618T130000
688 DTEND;VALUE=DATE-TIME:20010618T140000
689 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
690 SUMMARY:block no end time
693 ;; ======================================================================
695 ;; ======================================================================
697 (defun icalendar-tests--test-import (input expected-iso expected-european
699 "Perform import test.
700 Argument INPUT icalendar event string.
701 Argument EXPECTED-ISO expected iso style diary string.
702 Argument EXPECTED-EUROPEAN expected european style diary string.
703 Argument EXPECTED-AMERICAN expected american style diary string."
704 (let ((timezone (cadr (current-time-zone))))
705 (set-time-zone-rule "CET")
707 (if (string-match "^BEGIN:VCALENDAR" input
)
709 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
710 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
712 (unless (eq (char-before) ?
\n)
714 (insert "END:VEVENT\nEND:VCALENDAR\n"))
715 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
716 (icalendar-import-format-summary "%s")
717 (icalendar-import-format-location "\n Location: %s")
718 (icalendar-import-format-description "\n Desc: %s")
719 (icalendar-import-format-organizer "\n Organizer: %s")
720 (icalendar-import-format-status "\n Status: %s")
721 (icalendar-import-format-url "\n URL: %s")
722 (icalendar-import-format-class "\n Class: %s")
725 (setq calendar-date-style
'iso
)
726 (icalendar-tests--do-test-import input expected-iso
))
727 (when expected-european
728 (setq calendar-date-style
'european
)
729 (icalendar-tests--do-test-import input expected-european
))
730 (when expected-american
731 (setq calendar-date-style
'american
)
732 (icalendar-tests--do-test-import input expected-american
))))
733 (set-time-zone-rule timezone
)))
735 (defun icalendar-tests--do-test-import (input expected-output
)
736 "Actually perform import test.
737 Argument INPUT input icalendar string.
738 Argument EXPECTED-OUTPUT expected diary string."
739 (let ((temp-file (make-temp-file "icalendar-test-diary")))
740 (icalendar-import-buffer temp-file t t
)
743 (find-file temp-file
)
744 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
745 (should (icalendar-tests--compare-strings result
747 (kill-buffer (find-buffer-visiting temp-file
))
748 (delete-file temp-file
))))
750 (ert-deftest icalendar-import-non-recurring
()
751 "Perform standard import tests."
752 (icalendar-tests--test-import
753 "SUMMARY:non-recurring
754 DTSTART;VALUE=DATE-TIME:20030919T090000
755 DTEND;VALUE=DATE-TIME:20030919T113000"
756 "&2003/9/19 09:00-11:30 non-recurring"
757 "&19/9/2003 09:00-11:30 non-recurring"
758 "&9/19/2003 09:00-11:30 non-recurring")
759 (icalendar-tests--test-import
760 "SUMMARY:non-recurring allday
761 DTSTART;VALUE=DATE-TIME:20030919"
762 "&2003/9/19 non-recurring allday"
763 "&19/9/2003 non-recurring allday"
764 "&9/19/2003 non-recurring allday")
765 (icalendar-tests--test-import
766 ;; do not remove the trailing blank after "long"!
769 DTSTART;VALUE=DATE:20030919"
770 "&2003/9/19 long summary"
771 "&19/9/2003 long summary"
772 "&9/19/2003 long summary")
773 (icalendar-tests--test-import
774 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
778 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
779 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
780 DTSTART;VALUE=DATE:20040719
781 DTEND;VALUE=DATE:20040828
782 DTSTAMP:20031103T011641Z
784 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien
788 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien
792 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien
795 (icalendar-tests--test-import
797 :04979712-3902-11d9-93dd-8f9f4afe08da
804 X-MOZILLA-ALARM-DEFAULT-LENGTH
815 "&2004/11/23 14:00-14:30 folded summary
818 "&23/11/2004 14:00-14:30 folded summary
821 "&11/23/2004 14:00-14:30 folded summary
825 (icalendar-tests--test-import
827 :6161a312-3902-11d9-b512-f764153bb28b
834 X-MOZILLA-ALARM-DEFAULT-LENGTH
843 "&2004/11/23 14:45-15:45 another example
846 "&23/11/2004 14:45-15:45 another example
849 "&11/23/2004 14:45-15:45 another example
853 (ert-deftest icalendar-import-rrule
()
854 (icalendar-tests--test-import
856 DTSTART;VALUE=DATE-TIME:20030919T090000
857 DTEND;VALUE=DATE-TIME:20030919T113000
860 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily"
861 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily"
862 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily")
864 (icalendar-tests--test-import
866 DTSTART;VALUE=DATE-TIME:20030919T090000
867 DTEND;VALUE=DATE-TIME:20030919T113000
868 RRULE:FREQ=DAILY;INTERVAL=2
870 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily"
871 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily"
872 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily")
873 (icalendar-tests--test-import
874 "SUMMARY:rrule daily with exceptions
875 DTSTART;VALUE=DATE-TIME:20030919T090000
876 DTEND;VALUE=DATE-TIME:20030919T113000
877 RRULE:FREQ=DAILY;INTERVAL=2
878 EXDATE:20030921,20030925
880 "&%%(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"
881 "&%%(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"
882 "&%%(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")
883 (icalendar-tests--test-import
884 "SUMMARY:rrule weekly
885 DTSTART;VALUE=DATE-TIME:20030919T090000
886 DTEND;VALUE=DATE-TIME:20030919T113000
889 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly"
890 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly"
891 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly")
892 (icalendar-tests--test-import
893 "SUMMARY:rrule monthly no end
894 DTSTART;VALUE=DATE-TIME:20030919T090000
895 DTEND;VALUE=DATE-TIME:20030919T113000
898 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end"
899 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end"
900 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end")
901 (icalendar-tests--test-import
902 "SUMMARY:rrule monthly with end
903 DTSTART;VALUE=DATE-TIME:20030919T090000
904 DTEND;VALUE=DATE-TIME:20030919T113000
905 RRULE:FREQ=MONTHLY;UNTIL=20050819;
907 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end"
908 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end"
909 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end")
910 (icalendar-tests--test-import
911 "DTSTART;VALUE=DATE:20040815
912 DTEND;VALUE=DATE:20040816
913 SUMMARY:Maria Himmelfahrt
914 UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
915 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
917 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt"
918 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt"
919 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt")
920 (icalendar-tests--test-import
921 "SUMMARY:rrule yearly
922 DTSTART;VALUE=DATE-TIME:20030919T090000
923 DTEND;VALUE=DATE-TIME:20030919T113000
924 RRULE:FREQ=YEARLY;INTERVAL=2
926 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly" ;FIXME
927 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME
928 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME
929 (icalendar-tests--test-import
930 "SUMMARY:rrule count daily short
931 DTSTART;VALUE=DATE-TIME:20030919T090000
932 DTEND;VALUE=DATE-TIME:20030919T113000
933 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
935 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short"
936 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short"
937 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short")
938 (icalendar-tests--test-import
939 "SUMMARY:rrule count daily long
940 DTSTART;VALUE=DATE-TIME:20030919T090000
941 DTEND;VALUE=DATE-TIME:20030919T113000
942 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
944 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long"
945 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long"
946 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long")
947 (icalendar-tests--test-import
948 "SUMMARY:rrule count bi-weekly 3 times
949 DTSTART;VALUE=DATE-TIME:20030919T090000
950 DTEND;VALUE=DATE-TIME:20030919T113000
951 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
953 "&%%(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"
954 "&%%(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"
955 "&%%(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")
956 (icalendar-tests--test-import
957 "SUMMARY:rrule count monthly
958 DTSTART;VALUE=DATE-TIME:20030919T090000
959 DTEND;VALUE=DATE-TIME:20030919T113000
960 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
962 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly"
963 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly"
964 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly")
965 (icalendar-tests--test-import
966 "SUMMARY:rrule count every second month
967 DTSTART;VALUE=DATE-TIME:20030919T090000
968 DTEND;VALUE=DATE-TIME:20030919T113000
969 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
971 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month" ;FIXME
972 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME
973 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME
974 (icalendar-tests--test-import
975 "SUMMARY:rrule count yearly
976 DTSTART;VALUE=DATE-TIME:20030919T090000
977 DTEND;VALUE=DATE-TIME:20030919T113000
978 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
980 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly"
981 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly"
982 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly")
983 (icalendar-tests--test-import
984 "SUMMARY:rrule count every second year
985 DTSTART;VALUE=DATE-TIME:20030919T090000
986 DTEND;VALUE=DATE-TIME:20030919T113000
987 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
989 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year" ;FIXME!!!
990 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!!
991 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!!
994 (ert-deftest icalendar-import-duration
()
996 (icalendar-tests--test-import
997 "DTSTART;VALUE=DATE:20050217
1001 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration"
1002 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration"
1003 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration")
1004 (icalendar-tests--test-import
1005 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
1006 DTSTAMP:20041127T183315Z
1007 LAST-MODIFIED:20041127T183329
1009 DTSTART;VALUE=DATE:20011221
1010 DTEND;VALUE=DATE:20011221
1011 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
1014 CREATED:20041127T183329
1016 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub
1018 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub
1020 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub
1023 (ert-deftest icalendar-import-bug-6766
()
1024 ;;bug#6766 -- multiple byday values in a weekly rrule
1025 (icalendar-tests--test-import
1027 DTEND;TZID=America/New_York:20100421T120000
1028 DTSTAMP:20100525T141214Z
1029 DTSTART;TZID=America/New_York:20100421T113000
1030 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR
1035 UID:8814e3f9-7482-408f-996c-3bfe486a1262
1039 DTSTAMP:20100525T141214Z
1040 DTSTART;VALUE=DATE:20100422
1041 DTEND;VALUE=DATE:20100423
1042 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH
1044 SUMMARY:Tues + Thurs thinking
1046 UID:8814e3f9-7482-408f-996c-3bfe486a1263
1048 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum
1051 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking
1054 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum
1057 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking
1060 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum
1063 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking
1067 ;; ======================================================================
1069 ;; ======================================================================
1070 (defun icalendar-tests--test-cycle (input)
1071 "Perform cycle test.
1072 Argument INPUT icalendar event string."
1074 (if (string-match "^BEGIN:VCALENDAR" input
)
1076 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1077 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1079 (unless (eq (char-before) ?
\n)
1081 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1082 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
1083 (icalendar-import-format-summary "%s")
1084 (icalendar-import-format-location "\n Location: %s")
1085 (icalendar-import-format-description "\n Desc: %s")
1086 (icalendar-import-format-organizer "\n Organizer: %s")
1087 (icalendar-import-format-status "\n Status: %s")
1088 (icalendar-import-format-url "\n URL: %s")
1089 (icalendar-import-format-class "\n Class: %s"))
1090 (dolist (calendar-date-style '(iso european american
))
1091 (icalendar-tests--do-test-cycle)))))
1093 (defun icalendar-tests--do-test-cycle ()
1094 "Actually perform import/export cycle test."
1095 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1096 (temp-ics (make-temp-file "icalendar-test-ics"))
1097 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1102 (icalendar-import-buffer temp-diary t t
)
1104 ;; step 2: export what was just imported
1106 (find-file temp-diary
)
1107 (icalendar-export-region (point-min) (point-max) temp-ics
))
1109 ;; compare the output of step 2 with the input of step 1
1111 (find-file temp-ics
)
1112 (goto-char (point-min))
1113 (when (re-search-forward "\nUID:.*\n" nil t
)
1114 (replace-match "\n"))
1115 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1116 (should (icalendar-tests--compare-strings cycled org-input
)))))
1118 (kill-buffer (find-buffer-visiting temp-diary
))
1120 (set-buffer (find-buffer-visiting temp-ics
))
1121 (set-buffer-modified-p nil
)
1122 (kill-buffer (current-buffer)))
1123 (delete-file temp-diary
)
1124 (delete-file temp-ics
))))
1126 (ert-deftest icalendar-cycle
()
1127 "Perform cycling tests."
1128 (icalendar-tests--test-cycle
1129 "DTSTART;VALUE=DATE-TIME:20030919T090000
1130 DTEND;VALUE=DATE-TIME:20030919T113000
1133 (icalendar-tests--test-cycle
1134 "DTSTART;VALUE=DATE-TIME:20030919T090000
1135 DTEND;VALUE=DATE-TIME:20030919T113000
1137 DESCRIPTION:beschreibung!
1141 (icalendar-tests--test-cycle
1142 "DTSTART;VALUE=DATE:19190909
1143 DTEND;VALUE=DATE:19190910
1144 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1145 SUMMARY:and diary-anniversary
1148 ;; ======================================================================
1150 ;; ======================================================================
1151 (ert-deftest icalendar-real-world
()
1152 "Perform real-world tests, as gathered from problem reports."
1154 (icalendar-tests--test-import
1157 PRODID:Microsoft CDO for Microsoft Exchange
1160 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
1161 X-MICROSOFT-CDO-TZID:23
1163 DTSTART:16010101T000000
1168 DTSTART:16010101T000000
1174 DTSTAMP:20030509T043439Z
1175 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1176 SUMMARY:On-Site Interview
1177 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1178 010000000DB823520692542408ED02D7023F9DFF9
1179 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1180 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1181 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1182 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1183 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1184 zz\":MAILTO:zzzzzz@zzzzzzz.com
1185 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1187 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1188 DESCRIPTION:10:30am - Blah
1192 CREATED:20030509T043439Z
1193 LAST-MODIFIED:20030509T043459Z
1196 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1197 X-MICROSOFT-CDO-INSTTYPE:0
1198 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1199 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1200 X-MICROSOFT-CDO-IMPORTANCE:1
1201 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1204 DESCRIPTION:REMINDER
1205 TRIGGER;RELATED=START:-PT00H15M00S
1210 "&9/5/2003 10:30-15:30 On-Site Interview
1211 Desc: 10:30am - Blah
1213 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1215 "&5/9/2003 10:30-15:30 On-Site Interview
1216 Desc: 10:30am - Blah
1218 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1222 (icalendar-tests--test-import
1223 "DTSTAMP:20030618T195512Z
1224 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1225 SUMMARY:Dress Rehearsal for XXXX-XXXX
1226 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1227 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1228 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1229 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1230 ORGANIZER;CN=\"ABCD,TECHTRAINING
1231 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1232 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1233 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1234 DESCRIPTION:753 Zeichen hier radiert
1238 CREATED:20030618T195518Z
1239 LAST-MODIFIED:20030618T195527Z
1242 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1243 X-MICROSOFT-CDO-INSTTYPE:0
1244 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1245 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1246 X-MICROSOFT-CDO-IMPORTANCE:1
1247 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1250 DESCRIPTION:REMINDER
1251 TRIGGER;RELATED=START:-PT00H15M00S
1254 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1255 Desc: 753 Zeichen hier radiert
1256 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1257 Organizer: MAILTO:xxx@xxxxx.com
1259 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1260 Desc: 753 Zeichen hier radiert
1261 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1262 Organizer: MAILTO:xxx@xxxxx.com
1264 ;; 2003-06-18 b -- uses timezone
1265 (icalendar-tests--test-import
1268 PRODID:Microsoft CDO for Microsoft Exchange
1271 TZID:Mountain Time (US & Canada)
1272 X-MICROSOFT-CDO-TZID:12
1274 DTSTART:16010101T020000
1277 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1280 DTSTART:16010101T020000
1283 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1287 DTSTAMP:20030618T230323Z
1288 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1289 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1290 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1291 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1292 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1293 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1294 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1296 ORGANIZER;CN=\"ABCD,TECHTRAINING
1297 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1298 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1299 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1300 DESCRIPTION:Viele Zeichen standen hier früher
1304 CREATED:20030618T230326Z
1305 LAST-MODIFIED:20030618T230335Z
1308 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1309 X-MICROSOFT-CDO-INSTTYPE:0
1310 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1311 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1312 X-MICROSOFT-CDO-IMPORTANCE:1
1313 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1316 DESCRIPTION:REMINDER
1317 TRIGGER;RELATED=START:-PT00H15M00S
1322 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1323 Desc: Viele Zeichen standen hier früher
1324 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1325 Organizer: MAILTO:bbb@bbbbb.com
1327 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1328 Desc: Viele Zeichen standen hier früher
1329 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1330 Organizer: MAILTO:bbb@bbbbb.com
1332 ;; export 2004-10-28 block entries
1333 (icalendar-tests--test-export
1336 "-*- mode: text; fill-column: 256;-*-
1340 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1342 "DTSTART;VALUE=DATE:20041108
1343 DTEND;VALUE=DATE:20041111
1344 SUMMARY:Nov 8-10 aa")
1346 (icalendar-tests--test-export
1349 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1350 "DTSTART;VALUE=DATE:20041213
1351 DTEND;VALUE=DATE:20041218
1352 SUMMARY:Dec 13-17 bb")
1354 (icalendar-tests--test-export
1357 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1358 "DTSTART;VALUE=DATE:20050203
1359 DTEND;VALUE=DATE:20050205
1360 SUMMARY:Feb 3-4 cc")
1362 (icalendar-tests--test-export
1365 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1366 "DTSTART;VALUE=DATE:20050424
1367 DTEND;VALUE=DATE:20050430
1368 SUMMARY:April 24-29 dd
1370 (icalendar-tests--test-export
1373 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1374 "DTSTART;VALUE=DATE:20050530
1375 DTEND;VALUE=DATE:20050602
1376 SUMMARY:may 30 - June 1: ee")
1378 (icalendar-tests--test-export
1381 "%%(diary-block 6 6 2005 6 8 2005) ff"
1382 "DTSTART;VALUE=DATE:20050606
1383 DTEND;VALUE=DATE:20050609
1386 ;; export 2004-10-28 anniversary entries
1387 (icalendar-tests--test-export
1393 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1394 "DTSTART;VALUE=DATE:19910328
1395 DTEND;VALUE=DATE:19910329
1396 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1397 SUMMARY:aa birthday (%d years old)
1400 (icalendar-tests--test-export
1403 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1404 "DTSTART;VALUE=DATE:19570517
1405 DTEND;VALUE=DATE:19570518
1406 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1407 SUMMARY:bb birthday (%d years old)")
1409 (icalendar-tests--test-export
1412 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1413 "DTSTART;VALUE=DATE:19970608
1414 DTEND;VALUE=DATE:19970609
1415 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1416 SUMMARY:cc birthday (%d years old)")
1418 (icalendar-tests--test-export
1421 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1422 "DTSTART;VALUE=DATE:19830722
1423 DTEND;VALUE=DATE:19830723
1424 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1425 SUMMARY:dd (%d years ago...!)")
1427 (icalendar-tests--test-export
1430 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1431 "DTSTART;VALUE=DATE:19880801
1432 DTEND;VALUE=DATE:19880802
1433 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1434 SUMMARY:ee birthday (%d years old)")
1436 (icalendar-tests--test-export
1439 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1440 "DTSTART;VALUE=DATE:19570921
1441 DTEND;VALUE=DATE:19570922
1442 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1443 SUMMARY:ff birthday (%d years old)")
1448 ;; export 2004-10-28 monthly, weekly entries
1450 ;; (icalendar-tests--test-export
1453 ;; >>> ------------ monthly:
1455 ;; */27/* 10:00 blah blah"
1458 (icalendar-tests--test-export
1461 ">>> ------------ my week:
1464 "DTSTART;VALUE=DATE-TIME:20000103T130000
1465 DTEND;VALUE=DATE-TIME:20000103T140000
1466 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1469 (icalendar-tests--test-export
1473 "DTSTART;VALUE=DATE-TIME:20000103T150000
1474 DTEND;VALUE=DATE-TIME:20000103T160000
1475 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1479 (icalendar-tests--test-export
1482 "Monday 16:00-17:00 a2"
1483 "DTSTART;VALUE=DATE-TIME:20000103T160000
1484 DTEND;VALUE=DATE-TIME:20000103T170000
1485 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1488 (icalendar-tests--test-export
1491 "Tuesday 11:30-13:00 a3"
1492 "DTSTART;VALUE=DATE-TIME:20000104T113000
1493 DTEND;VALUE=DATE-TIME:20000104T130000
1494 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1497 (icalendar-tests--test-export
1501 "DTSTART;VALUE=DATE-TIME:20000104T150000
1502 DTEND;VALUE=DATE-TIME:20000104T160000
1503 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1506 (icalendar-tests--test-export
1509 "Wednesday 13:00 a5"
1510 "DTSTART;VALUE=DATE-TIME:20000105T130000
1511 DTEND;VALUE=DATE-TIME:20000105T140000
1512 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1515 (icalendar-tests--test-export
1518 "Wednesday 11:30-13:30 a6"
1519 "DTSTART;VALUE=DATE-TIME:20000105T113000
1520 DTEND;VALUE=DATE-TIME:20000105T133000
1521 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1524 (icalendar-tests--test-export
1527 "Wednesday 15:00 s1"
1528 "DTSTART;VALUE=DATE-TIME:20000105T150000
1529 DTEND;VALUE=DATE-TIME:20000105T160000
1530 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1534 ;; export 2004-10-28 regular entries
1535 (icalendar-tests--test-export
1539 >>> regular diary entries:
1541 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1542 "DTSTART;VALUE=DATE-TIME:20041012T140000
1543 DTEND;VALUE=DATE-TIME:20041012T150000
1544 SUMMARY:Tue: [2004-10-12] q1")
1547 (icalendar-tests--test-import
1552 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1555 :04979712-3902-11d9-93dd-8f9f4afe08da
1562 X-MOZILLA-ALARM-DEFAULT-LENGTH
1575 :6161a312-3902-11d9-b512-f764153bb28b
1582 X-MOZILLA-ALARM-DEFAULT-LENGTH
1593 :943a4d7e-3902-11d9-9ce7-c9addeadf928
1600 X-MOZILLA-ALARM-DEFAULT-LENGTH
1611 :fe53615e-3902-11d9-9dd8-9d38a155bf41
1618 X-MOZILLA-ALARM-DEFAULT-LENGTH
1620 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1623 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1633 :87c928ee-3901-11d9-b21f-b45042155024
1635 :Rrrr/Cccccc ii Aaaaaaaa
1637 :Vvvvv Rrrr aaa Cccccc
1642 X-MOZILLA-ALARM-DEFAULT-LENGTH
1657 :e8f331ae-3902-11d9-9948-dfdcb66a2872
1664 X-MOZILLA-ALARM-DEFAULT-LENGTH
1667 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1682 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1685 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1688 &23/11/2004 11:00-12:00 Hhhhhhhh
1691 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1694 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1695 Desc: Vvvvv Rrrr aaa Cccccc
1698 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1701 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1704 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1707 &11/23/2004 11:00-12:00 Hhhhhhhh
1710 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1713 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1714 Desc: Vvvvv Rrrr aaa Cccccc
1717 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1722 (icalendar-tests--test-export
1723 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1726 "DTSTART;VALUE=DATE:20040101
1727 DTEND;VALUE=DATE:20040105
1731 (icalendar-tests--test-export
1733 "5 11 2004 Bla Fasel"
1735 "DTSTART;VALUE=DATE:20041105
1736 DTEND;VALUE=DATE:20041106
1740 (icalendar-tests--test-export
1742 "2 Nov 2004 15:00-16:30 Zahnarzt"
1744 "DTSTART;VALUE=DATE-TIME:20041102T150000
1745 DTEND;VALUE=DATE-TIME:20041102T163000
1749 (icalendar-tests--test-import
1751 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1771 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1775 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1781 (icalendar-tests--test-import
1782 "DTSTART;VALUE=DATE:20050217
1783 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1784 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1785 DTSTAMP:20050118T210335Z
1788 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa"
1789 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa")
1792 (icalendar-tests--test-export
1794 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1796 "DTSTART;VALUE=DATE-TIME:20050208T160000
1797 DTEND;VALUE=DATE-TIME:20050208T164500
1798 RRULE:FREQ=DAILY;INTERVAL=7
1803 (icalendar-tests--test-export
1806 ;; FIXME: colon not allowed!
1807 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1808 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1809 "DTSTART;VALUE=DATE:19001101
1810 DTEND;VALUE=DATE:19001102
1811 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1812 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1816 (provide 'icalendar-tests
)
1817 ;;; icalendar-tests.el ends here