1 ;; icalendar-tests.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008-2013 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--calendar-style
()
84 "Test for `icalendar--date-style'."
85 (dolist (calendar-date-style '(iso american european
))
86 (should (eq (icalendar--date-style) calendar-date-style
)))
87 (let ((cds calendar-date-style
)
88 (european-calendar-style t
))
89 (makunbound 'calendar-date-style
)
90 (should (eq (icalendar--date-style) 'european
))
91 (with-no-warnings (setq european-calendar-style nil
)) ;still get warning!?! FIXME
92 (should (eq (icalendar--date-style) 'american
))
93 (setq calendar-date-style cds
)))
95 (ert-deftest icalendar-convert-anniversary-to-ical
()
96 "Test method for `icalendar--convert-anniversary-to-ical'."
97 (let* ((calendar-date-style 'iso
)
99 (setq result
(icalendar--convert-anniversary-to-ical
100 "" "%%(diary-anniversary 1964 6 30) g"))
101 (should (= 2 (length result
)))
102 (should (string= (concat
103 "\nDTSTART;VALUE=DATE:19640630"
104 "\nDTEND;VALUE=DATE:19640701"
105 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=30")
107 (should (string= "g" (cadr result
)))))
109 (ert-deftest icalendar--convert-cyclic-to-ical
()
110 "Test method for `icalendar--convert-cyclic-to-ical'."
111 (let* ((calendar-date-style 'iso
)
113 (setq result
(icalendar--convert-block-to-ical
114 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
115 (should (= 2 (length result
)))
116 (should (string= (concat
117 "\nDTSTART;VALUE=DATE:20040719"
118 "\nDTEND;VALUE=DATE:20040828")
120 (should (string= "Sommerferien" (cadr result
)))))
122 (ert-deftest icalendar--convert-block-to-ical
()
123 "Test method for `icalendar--convert-block-to-ical'."
124 (let* ((calendar-date-style 'iso
)
126 (setq result
(icalendar--convert-block-to-ical
127 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
128 (should (= 2 (length result
)))
129 (should (string= (concat
130 "\nDTSTART;VALUE=DATE:20040719"
131 "\nDTEND;VALUE=DATE:20040828")
133 (should (string= "Sommerferien" (cadr result
)))))
135 (ert-deftest icalendar--convert-yearly-to-ical
()
136 "Test method for `icalendar--convert-yearly-to-ical'."
137 (let* ((calendar-date-style 'iso
)
139 (calendar-month-name-array
140 ["January" "February" "March" "April" "May" "June" "July" "August"
141 "September" "October" "November" "December"]))
142 (setq result
(icalendar--convert-yearly-to-ical "" "May 1 Tag der Arbeit"))
143 (should (= 2 (length result
)))
144 (should (string= (concat
145 "\nDTSTART;VALUE=DATE:19000501"
146 "\nDTEND;VALUE=DATE:19000502"
147 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1")
149 (should (string= "Tag der Arbeit" (cadr result
)))))
151 (ert-deftest icalendar--convert-weekly-to-ical
()
152 "Test method for `icalendar--convert-weekly-to-ical'."
153 (let* ((calendar-date-style 'iso
)
155 (calendar-day-name-array
156 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
158 (setq result
(icalendar--convert-weekly-to-ical "" "Monday 8:30 subject"))
159 (should (= 2 (length result
)))
160 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20050103T083000"
161 "\nDTEND;VALUE=DATE-TIME:20050103T093000"
162 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO")
164 (should (string= "subject" (cadr result
)))))
166 (ert-deftest icalendar--parse-vtimezone
()
167 "Test method for `icalendar--parse-vtimezone'."
168 (let (vtimezone result
)
169 (setq vtimezone
(icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
172 DTSTART:16010101T040000
175 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
178 DTSTART:16010101T030000
181 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
185 (setq result
(icalendar--parse-vtimezone vtimezone
))
186 (should (string= "thename" (car result
)))
187 (message (cdr result
))
188 (should (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00"
190 (setq vtimezone
(icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
191 TZID:anothername\, with a comma
193 DTSTART:16010101T040000
196 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
199 DTSTART:16010101T030000
202 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
206 (setq result
(icalendar--parse-vtimezone vtimezone
))
207 (should (string= "anothername, with a comma" (car result
)))
208 (message (cdr result
))
209 (should (string= "STD-02:00DST-03:00,M3.2.1/03:00:00,M10.2.1/04:00:00"
212 (ert-deftest icalendar--convert-ordinary-to-ical
()
213 "Test method for `icalendar--convert-ordinary-to-ical'."
214 (let* ((calendar-date-style 'iso
)
217 (setq result
(icalendar--convert-ordinary-to-ical "&?" "2010 2 15 subject"))
218 (should (= 2 (length result
)))
219 (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216"
221 (should (string= "subject" (cadr result
)))
224 (setq result
(icalendar--convert-ordinary-to-ical
225 "&?" "&2010 2 15 12:34-23:45 s"))
226 (should (= 2 (length result
)))
227 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
228 "\nDTEND;VALUE=DATE-TIME:20100215T234500")
230 (should (string= "s" (cadr result
)))
232 ;; with time, again -- test bug#5549
233 (setq result
(icalendar--convert-ordinary-to-ical
234 "x?" "x2010 2 15 0:34-1:45 s"))
235 (should (= 2 (length result
)))
236 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400"
237 "\nDTEND;VALUE=DATE-TIME:20100215T014500")
239 (should (string= "s" (cadr result
)))))
241 (ert-deftest icalendar--diarytime-to-isotime
()
242 "Test method for `icalendar--diarytime-to-isotime'."
243 (should (string= "T011500"
244 (icalendar--diarytime-to-isotime "01:15" "")))
245 (should (string= "T011500"
246 (icalendar--diarytime-to-isotime "1:15" "")))
247 (should (string= "T000100"
248 (icalendar--diarytime-to-isotime "0:01" "")))
249 (should (string= "T010000"
250 (icalendar--diarytime-to-isotime "0100" "")))
251 (should (string= "T010000"
252 (icalendar--diarytime-to-isotime "0100" "am")))
253 (should (string= "T130000"
254 (icalendar--diarytime-to-isotime "0100" "pm")))
255 (should (string= "T120000"
256 (icalendar--diarytime-to-isotime "1200" "")))
257 (should (string= "T171700"
258 (icalendar--diarytime-to-isotime "17:17" "")))
259 (should (string= "T000000"
260 (icalendar--diarytime-to-isotime "1200" "am")))
261 (should (string= "T000100"
262 (icalendar--diarytime-to-isotime "1201" "am")))
263 (should (string= "T005900"
264 (icalendar--diarytime-to-isotime "1259" "am")))
265 (should (string= "T120000"
266 (icalendar--diarytime-to-isotime "1200" "pm")))
267 (should (string= "T120100"
268 (icalendar--diarytime-to-isotime "1201" "pm")))
269 (should (string= "T125900"
270 (icalendar--diarytime-to-isotime "1259" "pm"))))
272 (ert-deftest icalendar--datetime-to-diary-date
()
273 "Test method for `icalendar--datetime-to-diary-date'."
274 (let* ((datetime '(59 59 23 31 12 2008))
275 (calendar-date-style 'iso
))
276 (should (string= "2008 12 31"
277 (icalendar--datetime-to-diary-date datetime
)))
278 (setq calendar-date-style
'european
)
279 (should (string= "31 12 2008"
280 (icalendar--datetime-to-diary-date datetime
)))
281 (setq calendar-date-style
'american
)
282 (should (string= "12 31 2008"
283 (icalendar--datetime-to-diary-date datetime
)))))
285 (ert-deftest icalendar--datestring-to-isodate
()
286 "Test method for `icalendar--datestring-to-isodate'."
287 (let ((calendar-date-style 'iso
))
289 (should (string= "20080511"
290 (icalendar--datestring-to-isodate "2008 05 11")))
291 (should (string= "20080531"
292 (icalendar--datestring-to-isodate "2008 05 31")))
293 (should (string= "20080602"
294 (icalendar--datestring-to-isodate "2008 05 31" 2)))
297 (setq calendar-date-style
'european
)
298 (should (string= "20080511"
299 (icalendar--datestring-to-isodate "11 05 2008")))
300 (should (string= "20080531"
301 (icalendar--datestring-to-isodate "31 05 2008")))
302 (should (string= "20080602"
303 (icalendar--datestring-to-isodate "31 05 2008" 2)))
306 (setq calendar-date-style
'american
)
307 (should (string= "20081105"
308 (icalendar--datestring-to-isodate "11 05 2008")))
309 (should (string= "20081230"
310 (icalendar--datestring-to-isodate "12 30 2008")))
311 (should (string= "20090101"
312 (icalendar--datestring-to-isodate "12 30 2008" 2)))
315 (setq calendar-date-style nil
) ;not necessary for conversion
316 (should (string= "20081105"
317 (icalendar--datestring-to-isodate "Nov 05 2008")))
318 (should (string= "20081105"
319 (icalendar--datestring-to-isodate "05 Nov 2008")))
320 (should (string= "20081105"
321 (icalendar--datestring-to-isodate "2008 Nov 05")))))
323 (ert-deftest icalendar--first-weekday-of-year
()
324 "Test method for `icalendar-first-weekday-of-year'."
325 (should (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
326 (should (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
327 (should (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
328 (should (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
329 (should (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
330 (should (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
331 (should (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
332 (should (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
333 (should (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
335 (ert-deftest icalendar--import-format-sample
()
336 "Test method for `icalendar-import-format-sample'."
337 (should (string= (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
338 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'")
339 (icalendar-import-format-sample
340 (icalendar-tests--get-ical-event "BEGIN:VEVENT
341 DTSTAMP:20030509T043439Z
342 DTSTART:20030509T103000
346 DTEND:20030509T153000
351 (ert-deftest icalendar--format-ical-event
()
352 "Test `icalendar--format-ical-event'."
353 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
354 (icalendar-import-format-summary "SUM %s")
355 (icalendar-import-format-location " LOC %s")
356 (icalendar-import-format-description " DES %s")
357 (icalendar-import-format-organizer " ORG %s")
358 (icalendar-import-format-status " STA %s")
359 (icalendar-import-format-url " URL %s")
360 (icalendar-import-format-class " CLA %s")
361 (event (icalendar-tests--get-ical-event "BEGIN:VEVENT
362 DTSTAMP:20030509T043439Z
363 DTSTART:20030509T103000
367 DTEND:20030509T153000
371 (should (string= "SUM sum DES des LOC loc ORG org"
372 (icalendar--format-ical-event event
)))
373 (setq icalendar-import-format
(lambda (&rest ignore
)
375 (should (string= "helloworld" (icalendar--format-ical-event event
)))
376 (setq icalendar-import-format
378 (format "-%s-%s-%s-%s-%s-%s-%s-"
379 (icalendar--get-event-property event
'SUMMARY
)
380 (icalendar--get-event-property event
'DESCRIPTION
)
381 (icalendar--get-event-property event
'LOCATION
)
382 (icalendar--get-event-property event
'ORGANIZER
)
383 (icalendar--get-event-property event
'STATUS
)
384 (icalendar--get-event-property event
'URL
)
385 (icalendar--get-event-property event
'CLASS
))))
386 (should (string= "-sum-des-loc-org-nil-nil-nil-"
387 (icalendar--format-ical-event event
)))))
389 (ert-deftest icalendar--parse-summary-and-rest
()
390 "Test `icalendar--parse-summary-and-rest'."
391 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
392 (icalendar-import-format-summary "SUM %s")
393 (icalendar-import-format-location " LOC %s")
394 (icalendar-import-format-description " DES %s")
395 (icalendar-import-format-organizer " ORG %s")
396 (icalendar-import-format-status " STA %s")
397 (icalendar-import-format-url " URL %s")
398 (icalendar-import-format-class " CLA %s")
400 (setq result
(icalendar--parse-summary-and-rest "SUM sum ORG org"))
401 (should (string= "org" (cdr (assoc 'org result
))))
403 (setq result
(icalendar--parse-summary-and-rest
404 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
405 (should (string= "des" (cdr (assoc 'des result
))))
406 (should (string= "loc" (cdr (assoc 'loc result
))))
407 (should (string= "org" (cdr (assoc 'org result
))))
408 (should (string= "sta" (cdr (assoc 'sta result
))))
409 (should (string= "cla" (cdr (assoc 'cla result
))))
411 (setq icalendar-import-format
(lambda () "Hello world"))
412 (setq result
(icalendar--parse-summary-and-rest
414 (should (not result
))
417 ;; ======================================================================
419 ;; ======================================================================
421 (defun icalendar-tests--test-export (input-iso input-european input-american
423 "Perform an export test.
424 Argument INPUT-ISO iso style diary string.
425 Argument INPUT-EUROPEAN european style diary string.
426 Argument INPUT-AMERICAN american style diary string.
427 Argument EXPECTED-OUTPUT expected iCalendar result string.
429 European style input data must use german month names. American
430 and ISO style input data must use english month names."
431 (let ((tz (getenv "TZ"))
432 (calendar-date-style 'iso
)
433 (icalendar-recurring-start-year 2000))
436 ;;; (message "Current time zone: %s" (current-time-zone))
437 ;; Use this form so as not to rely on system tz database.
438 ;; Eg hydra.nixos.org.
439 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
440 ;;; (message "Current time zone: %s" (current-time-zone))
442 (let ((calendar-month-name-array
443 ["January" "February" "March" "April" "May" "June" "July" "August"
444 "September" "October" "November" "December"])
445 (calendar-day-name-array
446 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
448 (setq calendar-date-style
'iso
)
449 (icalendar-tests--do-test-export input-iso expected-output
)))
451 (let ((calendar-month-name-array
452 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
453 "September" "Oktober" "November" "Dezember"])
454 (calendar-day-name-array
455 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
457 (setq calendar-date-style
'european
)
458 (icalendar-tests--do-test-export input-european expected-output
)))
460 (let ((calendar-month-name-array
461 ["January" "February" "March" "April" "May" "June" "July" "August"
462 "September" "October" "November" "December"])
463 (calendar-day-name-array
464 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
466 (setq calendar-date-style
'american
)
467 (icalendar-tests--do-test-export input-american expected-output
))))
468 ;; restore time-zone even if something went terribly wrong
471 (defun icalendar-tests--do-test-export (input expected-output
)
472 "Actually perform export test.
473 Argument INPUT input diary string.
474 Argument EXPECTED-OUTPUT expected iCalendar result string."
475 (let ((temp-file (make-temp-file "icalendar-tests-ics")))
480 (icalendar-export-region (point-min) (point-max) temp-file
))
482 (find-file temp-file
)
483 (goto-char (point-min))
484 (cond (expected-output
485 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
486 PRODID:-//Emacs//NONSGML icalendar.el//EN
495 (should (string-match
497 (regexp-quote (buffer-substring-no-properties
498 (match-beginning 1) (match-end 1)))
502 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
503 PRODID:-//Emacs//NONSGML icalendar.el//EN
509 (kill-buffer (find-buffer-visiting temp-file
))
510 (delete-file temp-file
))))
512 (ert-deftest icalendar-export-ordinary-no-time
()
513 "Perform export test."
515 (let ((icalendar-export-hidden-diary-entries nil
))
516 (icalendar-tests--test-export
517 "&2000 Oct 3 ordinary no time "
518 "&3 Okt 2000 ordinary no time "
519 "&Oct 3 2000 ordinary no time "
522 (icalendar-tests--test-export
523 "2000 Oct 3 ordinary no time "
524 "3 Okt 2000 ordinary no time "
525 "Oct 3 2000 ordinary no time "
526 "DTSTART;VALUE=DATE:20001003
527 DTEND;VALUE=DATE:20001004
528 SUMMARY:ordinary no time
531 (ert-deftest icalendar-export-ordinary
()
532 "Perform export test."
534 (icalendar-tests--test-export
535 "2000 Oct 3 16:30 ordinary with time"
536 "3 Okt 2000 16:30 ordinary with time"
537 "Oct 3 2000 16:30 ordinary with time"
538 "DTSTART;VALUE=DATE-TIME:20001003T163000
539 DTEND;VALUE=DATE-TIME:20001003T173000
540 SUMMARY:ordinary with time
542 (icalendar-tests--test-export
543 "2000 10 3 16:30 ordinary with time 2"
544 "3 10 2000 16:30 ordinary with time 2"
545 "10 3 2000 16:30 ordinary with time 2"
546 "DTSTART;VALUE=DATE-TIME:20001003T163000
547 DTEND;VALUE=DATE-TIME:20001003T173000
548 SUMMARY:ordinary with time 2
551 (icalendar-tests--test-export
552 "2000/10/3 16:30 ordinary with time 3"
553 "3/10/2000 16:30 ordinary with time 3"
554 "10/3/2000 16:30 ordinary with time 3"
555 "DTSTART;VALUE=DATE-TIME:20001003T163000
556 DTEND;VALUE=DATE-TIME:20001003T173000
557 SUMMARY:ordinary with time 3
560 (ert-deftest icalendar-export-multiline
()
561 "Perform export test."
563 ;; multiline -- FIXME!!!
564 (icalendar-tests--test-export
565 "2000 October 3 16:30 multiline
566 17:30 multiline continued FIXME"
567 "3 Oktober 2000 16:30 multiline
568 17:30 multiline continued FIXME"
569 "October 3 2000 16:30 multiline
570 17:30 multiline continued FIXME"
571 "DTSTART;VALUE=DATE-TIME:20001003T163000
572 DTEND;VALUE=DATE-TIME:20001003T173000
575 17:30 multiline continued FIXME
578 (ert-deftest icalendar-export-weekly-by-day
()
579 "Perform export test."
582 (icalendar-tests--test-export
583 "Monday 1:30pm weekly by day with start time"
584 "Montag 13:30 weekly by day with start time"
585 "Monday 1:30pm weekly by day with start time"
586 "DTSTART;VALUE=DATE-TIME:20000103T133000
587 DTEND;VALUE=DATE-TIME:20000103T143000
588 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
589 SUMMARY:weekly by day with start time
592 (icalendar-tests--test-export
593 "Monday 13:30-15:00 weekly by day with start and end time"
594 "Montag 13:30-15:00 weekly by day with start and end time"
595 "Monday 01:30pm-03:00pm weekly by day with start and end time"
596 "DTSTART;VALUE=DATE-TIME:20000103T133000
597 DTEND;VALUE=DATE-TIME:20000103T150000
598 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
599 SUMMARY:weekly by day with start and end time
602 (ert-deftest icalendar-export-yearly
()
603 "Perform export test."
605 (icalendar-tests--test-export
606 "may 1 yearly no time"
607 "1 Mai yearly no time"
608 "may 1 yearly no time"
609 "DTSTART;VALUE=DATE:19000501
610 DTEND;VALUE=DATE:19000502
611 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
612 SUMMARY:yearly no time
615 (ert-deftest icalendar-export-anniversary
()
616 "Perform export test."
618 (icalendar-tests--test-export
619 "%%(diary-anniversary 1989 10 3) anniversary no time"
620 "%%(diary-anniversary 3 10 1989) anniversary no time"
621 "%%(diary-anniversary 10 3 1989) anniversary no time"
622 "DTSTART;VALUE=DATE:19891003
623 DTEND;VALUE=DATE:19891004
624 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
625 SUMMARY:anniversary no time
627 (icalendar-tests--test-export
628 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
629 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
630 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
631 "DTSTART;VALUE=DATE-TIME:19891003T190000
632 DTEND;VALUE=DATE-TIME:19891004T200000
633 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
634 SUMMARY:anniversary with time
637 (ert-deftest icalendar-export-block
()
638 "Perform export test."
640 (icalendar-tests--test-export
641 "%%(diary-block 2001 6 18 2001 7 6) block no time"
642 "%%(diary-block 18 6 2001 6 7 2001) block no time"
643 "%%(diary-block 6 18 2001 7 6 2001) block no time"
644 "DTSTART;VALUE=DATE:20010618
645 DTEND;VALUE=DATE:20010707
646 SUMMARY:block no time
648 (icalendar-tests--test-export
649 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
650 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
651 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
652 "DTSTART;VALUE=DATE-TIME:20010618T130000
653 DTEND;VALUE=DATE-TIME:20010618T170000
654 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
655 SUMMARY:block with time
657 (icalendar-tests--test-export
658 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
659 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
660 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
661 "DTSTART;VALUE=DATE-TIME:20010618T130000
662 DTEND;VALUE=DATE-TIME:20010618T140000
663 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
664 SUMMARY:block no end time
667 ;; ======================================================================
669 ;; ======================================================================
671 (defun icalendar-tests--test-import (input expected-iso expected-european
673 "Perform import test.
674 Argument INPUT icalendar event string.
675 Argument EXPECTED-ISO expected iso style diary string.
676 Argument EXPECTED-EUROPEAN expected european style diary string.
677 Argument EXPECTED-AMERICAN expected american style diary string."
678 (let ((timezone (getenv "TZ")))
681 ;;; (message "Current time zone: %s" (current-time-zone))
682 ;; Use this form so as not to rely on system tz database.
683 ;; Eg hydra.nixos.org.
684 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
685 ;;; (message "Current time zone: %s" (current-time-zone))
687 (if (string-match "^BEGIN:VCALENDAR" input
)
689 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
690 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
692 (unless (eq (char-before) ?
\n)
694 (insert "END:VEVENT\nEND:VCALENDAR\n"))
695 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
696 (icalendar-import-format-summary "%s")
697 (icalendar-import-format-location "\n Location: %s")
698 (icalendar-import-format-description "\n Desc: %s")
699 (icalendar-import-format-organizer "\n Organizer: %s")
700 (icalendar-import-format-status "\n Status: %s")
701 (icalendar-import-format-url "\n URL: %s")
702 (icalendar-import-format-class "\n Class: %s")
703 (icalendar-import-format-uid "\n UID: %s")
706 (setq calendar-date-style
'iso
)
707 (icalendar-tests--do-test-import input expected-iso
))
708 (when expected-european
709 (setq calendar-date-style
'european
)
710 (icalendar-tests--do-test-import input expected-european
))
711 (when expected-american
712 (setq calendar-date-style
'american
)
713 (icalendar-tests--do-test-import input expected-american
)))))
714 (setenv "TZ" timezone
))))
716 (defun icalendar-tests--do-test-import (input expected-output
)
717 "Actually perform import test.
718 Argument INPUT input icalendar string.
719 Argument EXPECTED-OUTPUT expected diary string."
720 (let ((temp-file (make-temp-file "icalendar-test-diary")))
721 (icalendar-import-buffer temp-file t t
)
723 (find-file temp-file
)
724 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
725 (should (string= expected-output result
)))
726 (kill-buffer (find-buffer-visiting temp-file
))
727 (delete-file temp-file
))))
729 (ert-deftest icalendar-import-non-recurring
()
730 "Perform standard import tests."
731 (icalendar-tests--test-import
732 "SUMMARY:non-recurring
733 DTSTART;VALUE=DATE-TIME:20030919T090000
734 DTEND;VALUE=DATE-TIME:20030919T113000"
735 "&2003/9/19 09:00-11:30 non-recurring\n"
736 "&19/9/2003 09:00-11:30 non-recurring\n"
737 "&9/19/2003 09:00-11:30 non-recurring\n")
738 (icalendar-tests--test-import
739 "SUMMARY:non-recurring allday
740 DTSTART;VALUE=DATE-TIME:20030919"
741 "&2003/9/19 non-recurring allday\n"
742 "&19/9/2003 non-recurring allday\n"
743 "&9/19/2003 non-recurring allday\n")
744 (icalendar-tests--test-import
745 ;; Checkdoc removes trailing blanks. Therefore: format!
746 (format "%s\n%s\n%s" "SUMMARY:long " " summary"
747 "DTSTART;VALUE=DATE:20030919")
748 "&2003/9/19 long summary\n"
749 "&19/9/2003 long summary\n"
750 "&9/19/2003 long summary\n")
751 (icalendar-tests--test-import
752 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
756 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
757 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
758 DTSTART;VALUE=DATE:20040719
759 DTEND;VALUE=DATE:20040828
760 DTSTAMP:20031103T011641Z
762 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien
765 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
767 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien
770 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
772 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien
775 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
777 (icalendar-tests--test-import
779 :04979712-3902-11d9-93dd-8f9f4afe08da
786 X-MOZILLA-ALARM-DEFAULT-LENGTH
797 "&2004/11/23 14:00-14:30 folded summary
800 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
801 "&23/11/2004 14:00-14:30 folded summary
804 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
805 "&11/23/2004 14:00-14:30 folded summary
808 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n")
810 (icalendar-tests--test-import
812 :6161a312-3902-11d9-b512-f764153bb28b
819 X-MOZILLA-ALARM-DEFAULT-LENGTH
828 "&2004/11/23 14:45-15:45 another example
831 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
832 "&23/11/2004 14:45-15:45 another example
835 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
836 "&11/23/2004 14:45-15:45 another example
839 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"))
841 (ert-deftest icalendar-import-rrule
()
842 (icalendar-tests--test-import
844 DTSTART;VALUE=DATE-TIME:20030919T090000
845 DTEND;VALUE=DATE-TIME:20030919T113000
848 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily\n"
849 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily\n"
850 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily\n")
852 (icalendar-tests--test-import
854 DTSTART;VALUE=DATE-TIME:20030919T090000
855 DTEND;VALUE=DATE-TIME:20030919T113000
856 RRULE:FREQ=DAILY;INTERVAL=2
858 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily\n"
859 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily\n"
860 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily\n")
861 (icalendar-tests--test-import
862 "SUMMARY:rrule daily with exceptions
863 DTSTART;VALUE=DATE-TIME:20030919T090000
864 DTEND;VALUE=DATE-TIME:20030919T113000
865 RRULE:FREQ=DAILY;INTERVAL=2
866 EXDATE:20030921,20030925
868 "&%%(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"
869 "&%%(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"
870 "&%%(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")
871 (icalendar-tests--test-import
872 "SUMMARY:rrule weekly
873 DTSTART;VALUE=DATE-TIME:20030919T090000
874 DTEND;VALUE=DATE-TIME:20030919T113000
877 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly\n"
878 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly\n"
879 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly\n")
880 (icalendar-tests--test-import
881 "SUMMARY:rrule monthly no end
882 DTSTART;VALUE=DATE-TIME:20030919T090000
883 DTEND;VALUE=DATE-TIME:20030919T113000
886 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end\n"
887 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n"
888 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n")
889 (icalendar-tests--test-import
890 "SUMMARY:rrule monthly with end
891 DTSTART;VALUE=DATE-TIME:20030919T090000
892 DTEND;VALUE=DATE-TIME:20030919T113000
893 RRULE:FREQ=MONTHLY;UNTIL=20050819;
895 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end\n"
896 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end\n"
897 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end\n")
898 (icalendar-tests--test-import
899 "DTSTART;VALUE=DATE:20040815
900 DTEND;VALUE=DATE:20040816
901 SUMMARY:Maria Himmelfahrt
902 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
904 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt\n"
905 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt\n"
906 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt\n")
907 (icalendar-tests--test-import
908 "SUMMARY:rrule yearly
909 DTSTART;VALUE=DATE-TIME:20030919T090000
910 DTEND;VALUE=DATE-TIME:20030919T113000
911 RRULE:FREQ=YEARLY;INTERVAL=2
913 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly\n" ;FIXME
914 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly\n" ;FIXME
915 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly\n") ;FIXME
916 (icalendar-tests--test-import
917 "SUMMARY:rrule count daily short
918 DTSTART;VALUE=DATE-TIME:20030919T090000
919 DTEND;VALUE=DATE-TIME:20030919T113000
920 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
922 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short\n"
923 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short\n"
924 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short\n")
925 (icalendar-tests--test-import
926 "SUMMARY:rrule count daily long
927 DTSTART;VALUE=DATE-TIME:20030919T090000
928 DTEND;VALUE=DATE-TIME:20030919T113000
929 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
931 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long\n"
932 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long\n"
933 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long\n")
934 (icalendar-tests--test-import
935 "SUMMARY:rrule count bi-weekly 3 times
936 DTSTART;VALUE=DATE-TIME:20030919T090000
937 DTEND;VALUE=DATE-TIME:20030919T113000
938 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
940 "&%%(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"
941 "&%%(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"
942 "&%%(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")
943 (icalendar-tests--test-import
944 "SUMMARY:rrule count monthly
945 DTSTART;VALUE=DATE-TIME:20030919T090000
946 DTEND;VALUE=DATE-TIME:20030919T113000
947 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
949 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly\n"
950 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly\n"
951 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly\n")
952 (icalendar-tests--test-import
953 "SUMMARY:rrule count every second month
954 DTSTART;VALUE=DATE-TIME:20030919T090000
955 DTEND;VALUE=DATE-TIME:20030919T113000
956 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
958 "&%%(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
959 "&%%(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
960 "&%%(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
961 (icalendar-tests--test-import
962 "SUMMARY:rrule count yearly
963 DTSTART;VALUE=DATE-TIME:20030919T090000
964 DTEND;VALUE=DATE-TIME:20030919T113000
965 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
967 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly\n"
968 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly\n"
969 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly\n")
970 (icalendar-tests--test-import
971 "SUMMARY:rrule count every second year
972 DTSTART;VALUE=DATE-TIME:20030919T090000
973 DTEND;VALUE=DATE-TIME:20030919T113000
974 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
976 "&%%(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!!!
977 "&%%(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!!!
978 "&%%(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!!!
981 (ert-deftest icalendar-import-duration
()
983 (icalendar-tests--test-import
984 "DTSTART;VALUE=DATE:20050217
988 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration\n"
989 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration\n"
990 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration\n")
991 (icalendar-tests--test-import
992 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
993 DTSTAMP:20041127T183315Z
994 LAST-MODIFIED:20041127T183329
996 DTSTART;VALUE=DATE:20011221
997 DTEND;VALUE=DATE:20011221
998 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
1001 CREATED:20041127T183329
1003 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub
1005 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1006 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub
1008 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1009 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub
1011 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"))
1013 (ert-deftest icalendar-import-bug-6766
()
1014 ;;bug#6766 -- multiple byday values in a weekly rrule
1015 (icalendar-tests--test-import
1017 DTEND;TZID=America/New_York:20100421T120000
1018 DTSTAMP:20100525T141214Z
1019 DTSTART;TZID=America/New_York:20100421T113000
1020 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR
1025 UID:8814e3f9-7482-408f-996c-3bfe486a1262
1029 DTSTAMP:20100525T141214Z
1030 DTSTART;VALUE=DATE:20100422
1031 DTEND;VALUE=DATE:20100423
1032 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH
1034 SUMMARY:Tues + Thurs thinking
1036 UID:8814e3f9-7482-408f-996c-3bfe486a1263
1038 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum
1041 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1042 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking
1044 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1046 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum
1049 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1050 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking
1052 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1054 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum
1057 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1058 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking
1060 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1063 (ert-deftest icalendar-import-multiple-vcalendars
()
1064 (icalendar-tests--test-import
1065 "DTSTART;VALUE=DATE:20110723
1068 "&2011/7/23 event-1\n"
1069 "&23/7/2011 event-1\n"
1070 "&7/23/2011 event-1\n")
1072 (icalendar-tests--test-import
1074 PRODID:-//Emacs//NONSGML icalendar.el//EN
1075 VERSION:2.0\nBEGIN:VEVENT
1076 DTSTART;VALUE=DATE:20110723
1081 PRODID:-//Emacs//NONSGML icalendar.el//EN
1084 DTSTART;VALUE=DATE:20110724
1089 PRODID:-//Emacs//NONSGML icalendar.el//EN
1092 DTSTART;VALUE=DATE:20110725
1096 DTSTART;VALUE=DATE:20110725
1101 "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n"
1102 "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n"
1103 "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n"))
1105 (ert-deftest icalendar-import-with-uid
()
1106 "Perform import test with uid."
1107 (icalendar-tests--test-import
1109 SUMMARY:non-recurring
1110 DTSTART;VALUE=DATE-TIME:20030919T090000
1111 DTEND;VALUE=DATE-TIME:20030919T113000"
1112 "&2003/9/19 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1113 "&19/9/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1114 "&9/19/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"))
1116 (ert-deftest icalendar-import-with-timezone
()
1118 (icalendar-tests--test-import
1121 TZID:fictional\, nonexistent\, arbitrary
1123 DTSTART:20100101T000000
1126 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01
1129 DTSTART:20101201T000000
1132 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
1136 SUMMARY:standardtime
1137 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000
1138 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000
1141 SUMMARY:daylightsavingtime
1142 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000
1143 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000
1146 ;; "standardtime" begins first sunday in january and is 4 hours behind CET
1147 ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET
1148 "&2012/1/15 15:00-15:30 standardtime
1149 &2012/12/15 11:00-11:30 daylightsavingtime
1154 ;; ======================================================================
1156 ;; ======================================================================
1157 (defun icalendar-tests--test-cycle (input)
1158 "Perform cycle test.
1159 Argument INPUT icalendar event string."
1161 (if (string-match "^BEGIN:VCALENDAR" input
)
1163 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1164 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1166 (unless (eq (char-before) ?
\n)
1168 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1169 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
1170 (icalendar-import-format-summary "%s")
1171 (icalendar-import-format-location "\n Location: %s")
1172 (icalendar-import-format-description "\n Desc: %s")
1173 (icalendar-import-format-organizer "\n Organizer: %s")
1174 (icalendar-import-format-status "\n Status: %s")
1175 (icalendar-import-format-url "\n URL: %s")
1176 (icalendar-import-format-class "\n Class: %s")
1177 (icalendar-import-format-class "\n UID: %s"))
1178 (dolist (calendar-date-style '(iso european american
))
1179 (icalendar-tests--do-test-cycle)))))
1181 (defun icalendar-tests--do-test-cycle ()
1182 "Actually perform import/export cycle test."
1183 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1184 (temp-ics (make-temp-file "icalendar-test-ics"))
1185 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1190 (icalendar-import-buffer temp-diary t t
)
1192 ;; step 2: export what was just imported
1194 (find-file temp-diary
)
1195 (icalendar-export-region (point-min) (point-max) temp-ics
))
1197 ;; compare the output of step 2 with the input of step 1
1199 (find-file temp-ics
)
1200 (goto-char (point-min))
1201 ;;(when (re-search-forward "\nUID:.*\n" nil t)
1202 ;;(replace-match "\n"))
1203 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1204 (should (string= org-input cycled
)))))
1206 (kill-buffer (find-buffer-visiting temp-diary
))
1207 (with-current-buffer (find-buffer-visiting temp-ics
)
1208 (set-buffer-modified-p nil
)
1209 (kill-buffer (current-buffer)))
1210 (delete-file temp-diary
)
1211 (delete-file temp-ics
))))
1213 (ert-deftest icalendar-cycle
()
1214 "Perform cycling tests.
1215 Take care to avoid auto-generated UIDs here."
1216 (icalendar-tests--test-cycle
1218 DTSTART;VALUE=DATE-TIME:20030919T090000
1219 DTEND;VALUE=DATE-TIME:20030919T113000
1222 (icalendar-tests--test-cycle
1224 DTSTART;VALUE=DATE-TIME:20030919T090000
1225 DTEND;VALUE=DATE-TIME:20030919T113000
1227 DESCRIPTION:beschreibung!
1231 (icalendar-tests--test-cycle
1233 DTSTART;VALUE=DATE:19190909
1234 DTEND;VALUE=DATE:19190910
1235 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1236 SUMMARY:and diary-anniversary
1239 ;; ======================================================================
1241 ;; ======================================================================
1242 (ert-deftest icalendar-real-world
()
1243 "Perform real-world tests, as gathered from problem reports."
1245 (icalendar-tests--test-import
1248 PRODID:Microsoft CDO for Microsoft Exchange
1251 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
1252 X-MICROSOFT-CDO-TZID:23
1254 DTSTART:16010101T000000
1259 DTSTART:16010101T000000
1265 DTSTAMP:20030509T043439Z
1266 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1267 SUMMARY:On-Site Interview
1268 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1269 010000000DB823520692542408ED02D7023F9DFF9
1270 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1271 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1272 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1273 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1274 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1275 zz\":MAILTO:zzzzzz@zzzzzzz.com
1276 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1278 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1279 DESCRIPTION:10:30am - Blah
1283 CREATED:20030509T043439Z
1284 LAST-MODIFIED:20030509T043459Z
1287 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1288 X-MICROSOFT-CDO-INSTTYPE:0
1289 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1290 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1291 X-MICROSOFT-CDO-IMPORTANCE:1
1292 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1295 DESCRIPTION:REMINDER
1296 TRIGGER;RELATED=START:-PT00H15M00S
1301 "&9/5/2003 10:30-15:30 On-Site Interview
1302 Desc: 10:30am - Blah
1304 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1306 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1308 "&5/9/2003 10:30-15:30 On-Site Interview
1309 Desc: 10:30am - Blah
1311 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1313 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1317 (icalendar-tests--test-import
1318 "DTSTAMP:20030618T195512Z
1319 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1320 SUMMARY:Dress Rehearsal for XXXX-XXXX
1321 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1322 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1323 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1324 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1325 ORGANIZER;CN=\"ABCD,TECHTRAINING
1326 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1327 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1328 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1329 DESCRIPTION:753 Zeichen hier radiert
1333 CREATED:20030618T195518Z
1334 LAST-MODIFIED:20030618T195527Z
1337 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1338 X-MICROSOFT-CDO-INSTTYPE:0
1339 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1340 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1341 X-MICROSOFT-CDO-IMPORTANCE:1
1342 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1345 DESCRIPTION:REMINDER
1346 TRIGGER;RELATED=START:-PT00H15M00S
1349 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1350 Desc: 753 Zeichen hier radiert
1351 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1352 Organizer: MAILTO:xxx@xxxxx.com
1354 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1356 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1357 Desc: 753 Zeichen hier radiert
1358 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1359 Organizer: MAILTO:xxx@xxxxx.com
1361 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1363 ;; 2003-06-18 b -- uses timezone
1364 (icalendar-tests--test-import
1367 PRODID:Microsoft CDO for Microsoft Exchange
1370 TZID:Mountain Time (US & Canada)
1371 X-MICROSOFT-CDO-TZID:12
1373 DTSTART:16010101T020000
1376 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1379 DTSTART:16010101T020000
1382 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1386 DTSTAMP:20030618T230323Z
1387 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1388 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1389 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1390 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1391 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1392 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1393 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1395 ORGANIZER;CN=\"ABCD,TECHTRAINING
1396 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1397 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1398 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1399 DESCRIPTION:Viele Zeichen standen hier früher
1403 CREATED:20030618T230326Z
1404 LAST-MODIFIED:20030618T230335Z
1407 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1408 X-MICROSOFT-CDO-INSTTYPE:0
1409 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1410 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1411 X-MICROSOFT-CDO-IMPORTANCE:1
1412 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1415 DESCRIPTION:REMINDER
1416 TRIGGER;RELATED=START:-PT00H15M00S
1421 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1422 Desc: Viele Zeichen standen hier früher
1423 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1424 Organizer: MAILTO:bbb@bbbbb.com
1426 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1428 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1429 Desc: Viele Zeichen standen hier früher
1430 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1431 Organizer: MAILTO:bbb@bbbbb.com
1433 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1435 ;; export 2004-10-28 block entries
1436 (icalendar-tests--test-export
1439 "-*- mode: text; fill-column: 256;-*-
1443 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1445 "DTSTART;VALUE=DATE:20041108
1446 DTEND;VALUE=DATE:20041111
1447 SUMMARY:Nov 8-10 aa")
1449 (icalendar-tests--test-export
1452 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1453 "DTSTART;VALUE=DATE:20041213
1454 DTEND;VALUE=DATE:20041218
1455 SUMMARY:Dec 13-17 bb")
1457 (icalendar-tests--test-export
1460 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1461 "DTSTART;VALUE=DATE:20050203
1462 DTEND;VALUE=DATE:20050205
1463 SUMMARY:Feb 3-4 cc")
1465 (icalendar-tests--test-export
1468 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1469 "DTSTART;VALUE=DATE:20050424
1470 DTEND;VALUE=DATE:20050430
1471 SUMMARY:April 24-29 dd
1473 (icalendar-tests--test-export
1476 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1477 "DTSTART;VALUE=DATE:20050530
1478 DTEND;VALUE=DATE:20050602
1479 SUMMARY:may 30 - June 1: ee")
1481 (icalendar-tests--test-export
1484 "%%(diary-block 6 6 2005 6 8 2005) ff"
1485 "DTSTART;VALUE=DATE:20050606
1486 DTEND;VALUE=DATE:20050609
1489 ;; export 2004-10-28 anniversary entries
1490 (icalendar-tests--test-export
1496 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1497 "DTSTART;VALUE=DATE:19910328
1498 DTEND;VALUE=DATE:19910329
1499 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1500 SUMMARY:aa birthday (%d years old)
1503 (icalendar-tests--test-export
1506 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1507 "DTSTART;VALUE=DATE:19570517
1508 DTEND;VALUE=DATE:19570518
1509 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1510 SUMMARY:bb birthday (%d years old)")
1512 (icalendar-tests--test-export
1515 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1516 "DTSTART;VALUE=DATE:19970608
1517 DTEND;VALUE=DATE:19970609
1518 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1519 SUMMARY:cc birthday (%d years old)")
1521 (icalendar-tests--test-export
1524 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1525 "DTSTART;VALUE=DATE:19830722
1526 DTEND;VALUE=DATE:19830723
1527 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1528 SUMMARY:dd (%d years ago...!)")
1530 (icalendar-tests--test-export
1533 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1534 "DTSTART;VALUE=DATE:19880801
1535 DTEND;VALUE=DATE:19880802
1536 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1537 SUMMARY:ee birthday (%d years old)")
1539 (icalendar-tests--test-export
1542 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1543 "DTSTART;VALUE=DATE:19570921
1544 DTEND;VALUE=DATE:19570922
1545 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1546 SUMMARY:ff birthday (%d years old)")
1551 ;; export 2004-10-28 monthly, weekly entries
1553 ;; (icalendar-tests--test-export
1556 ;; >>> ------------ monthly:
1558 ;; */27/* 10:00 blah blah"
1561 (icalendar-tests--test-export
1564 ">>> ------------ my week:
1567 "DTSTART;VALUE=DATE-TIME:20000103T130000
1568 DTEND;VALUE=DATE-TIME:20000103T140000
1569 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1572 (icalendar-tests--test-export
1576 "DTSTART;VALUE=DATE-TIME:20000103T150000
1577 DTEND;VALUE=DATE-TIME:20000103T160000
1578 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1582 (icalendar-tests--test-export
1585 "Monday 16:00-17:00 a2"
1586 "DTSTART;VALUE=DATE-TIME:20000103T160000
1587 DTEND;VALUE=DATE-TIME:20000103T170000
1588 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1591 (icalendar-tests--test-export
1594 "Tuesday 11:30-13:00 a3"
1595 "DTSTART;VALUE=DATE-TIME:20000104T113000
1596 DTEND;VALUE=DATE-TIME:20000104T130000
1597 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1600 (icalendar-tests--test-export
1604 "DTSTART;VALUE=DATE-TIME:20000104T150000
1605 DTEND;VALUE=DATE-TIME:20000104T160000
1606 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1609 (icalendar-tests--test-export
1612 "Wednesday 13:00 a5"
1613 "DTSTART;VALUE=DATE-TIME:20000105T130000
1614 DTEND;VALUE=DATE-TIME:20000105T140000
1615 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1618 (icalendar-tests--test-export
1621 "Wednesday 11:30-13:30 a6"
1622 "DTSTART;VALUE=DATE-TIME:20000105T113000
1623 DTEND;VALUE=DATE-TIME:20000105T133000
1624 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1627 (icalendar-tests--test-export
1630 "Wednesday 15:00 s1"
1631 "DTSTART;VALUE=DATE-TIME:20000105T150000
1632 DTEND;VALUE=DATE-TIME:20000105T160000
1633 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1637 ;; export 2004-10-28 regular entries
1638 (icalendar-tests--test-export
1642 >>> regular diary entries:
1644 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1645 "DTSTART;VALUE=DATE-TIME:20041012T140000
1646 DTEND;VALUE=DATE-TIME:20041012T150000
1647 SUMMARY:Tue: [2004-10-12] q1")
1650 (icalendar-tests--test-import
1655 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1663 X-MOZILLA-ALARM-DEFAULT-LENGTH
1681 X-MOZILLA-ALARM-DEFAULT-LENGTH
1697 X-MOZILLA-ALARM-DEFAULT-LENGTH
1713 X-MOZILLA-ALARM-DEFAULT-LENGTH
1715 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1718 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1728 :Rrrr/Cccccc ii Aaaaaaaa
1730 :Vvvvv Rrrr aaa Cccccc
1735 X-MOZILLA-ALARM-DEFAULT-LENGTH
1755 X-MOZILLA-ALARM-DEFAULT-LENGTH
1758 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1773 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1776 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1779 &23/11/2004 11:00-12:00 Hhhhhhhh
1782 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1785 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1786 Desc: Vvvvv Rrrr aaa Cccccc
1789 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1793 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1796 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1799 &11/23/2004 11:00-12:00 Hhhhhhhh
1802 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1805 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1806 Desc: Vvvvv Rrrr aaa Cccccc
1809 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1815 (icalendar-tests--test-export
1816 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1819 "DTSTART;VALUE=DATE:20040101
1820 DTEND;VALUE=DATE:20040105
1824 (icalendar-tests--test-export
1826 "5 11 2004 Bla Fasel"
1828 "DTSTART;VALUE=DATE:20041105
1829 DTEND;VALUE=DATE:20041106
1833 (icalendar-tests--test-export
1835 "2 Nov 2004 15:00-16:30 Zahnarzt"
1837 "DTSTART;VALUE=DATE-TIME:20041102T150000
1838 DTEND;VALUE=DATE-TIME:20041102T163000
1842 (icalendar-tests--test-import
1844 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1864 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1868 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
1870 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1874 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
1878 (icalendar-tests--test-import
1879 "DTSTART;VALUE=DATE:20050217
1880 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1881 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1882 DTSTAMP:20050118T210335Z
1885 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
1886 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n"
1887 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
1888 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n")
1891 (icalendar-tests--test-export
1893 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1895 "DTSTART;VALUE=DATE-TIME:20050208T160000
1896 DTEND;VALUE=DATE-TIME:20050208T164500
1897 RRULE:FREQ=DAILY;INTERVAL=7
1902 (icalendar-tests--test-export
1905 ;; FIXME: colon not allowed!
1906 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1907 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1908 "DTSTART;VALUE=DATE:19001101
1909 DTEND;VALUE=DATE:19001102
1910 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1911 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1915 (icalendar-tests--test-import
1918 PRODID:Microsoft Exchange Server 2007
1921 TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna
1923 DTSTART:16010101T030000
1926 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
1929 DTSTART:16010101T020000
1932 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
1936 ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com
1937 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth
1938 er\":MAILTO:other.luser@foo.com
1939 DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n
1940 SUMMARY;LANGUAGE=en-US:Query
1941 DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\"
1943 DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2
1945 UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000
1946 010000000575268034ECDB649A15349B1BF240F15
1947 RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V
1948 ienna\":20120515T170000
1951 DTSTAMP:20120514T153645Z
1955 LOCATION;LANGUAGE=en-US:phone
1956 X-MICROSOFT-CDO-APPT-SEQUENCE:15
1957 X-MICROSOFT-CDO-OWNERAPPTID:1907632092
1958 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
1959 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1960 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1961 X-MICROSOFT-CDO-IMPORTANCE:1
1962 X-MICROSOFT-CDO-INSTTYPE:3
1965 DESCRIPTION:REMINDER
1966 TRIGGER;RELATED=START:-PT15M
1971 "&15/5/2012 15:00-15:30 Query
1973 Organizer: MAILTO:a.luser@foo.com
1976 UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15
1980 (provide 'icalendar-tests
)
1981 ;;; icalendar-tests.el ends here