1 ;; icalendar-testsuite.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008, 2009, 2010 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.
33 (defun icalendar-testsuite-run ()
34 "Run icalendar test suite."
36 (icalendar-testsuite--run-function-tests)
37 (icalendar-testsuite--run-import-tests)
38 (icalendar-testsuite--run-export-tests)
39 (icalendar-testsuite--run-cycle-tests)
40 (icalendar-testsuite--run-real-world-tests)
41 (message "All icalendar tests finished successfully."))
43 ;; ======================================================================
44 ;; Test methods for functions
45 ;; ======================================================================
46 (defun icalendar-testsuite--run-function-tests ()
47 "Perform tests for single icalendar functions."
48 (icalendar-testsuite--test-parse-summary-and-rest)
49 (icalendar-testsuite--test-format-ical-event)
50 (icalendar-testsuite--test-import-format-sample)
51 (icalendar-testsuite--test-first-weekday-of-year)
52 (icalendar-testsuite--test-datestring-to-isodate)
53 (icalendar-testsuite--test-datetime-to-diary-date)
54 (icalendar-testsuite--test-diarytime-to-isotime)
55 (icalendar-testsuite--test-calendar-style)
56 (icalendar-testsuite--test-create-uid)
57 (icalendar-testsuite--test-parse-vtimezone))
59 (defun icalendar-testsuite--test-format-ical-event ()
60 "Test `icalendar--format-ical-event'."
61 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
62 (icalendar-import-format-summary "SUM %s")
63 (icalendar-import-format-location " LOC %s")
64 (icalendar-import-format-description " DES %s")
65 (icalendar-import-format-organizer " ORG %s")
66 (icalendar-import-format-status " STA %s")
67 (icalendar-import-format-url " URL %s")
68 (icalendar-import-format-class " CLA %s")
69 (event (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
70 DTSTAMP:20030509T043439Z
71 DTSTART:20030509T103000
79 (assert (string= (icalendar--format-ical-event event
)
80 "SUM sum DES des LOC loc ORG org") t
)
81 (setq icalendar-import-format
(lambda (&rest ignore
)
83 (assert (string= (icalendar--format-ical-event event
)
85 (setq icalendar-import-format
87 (format "-%s-%s-%s-%s-%s-%s-%s-"
88 (icalendar--get-event-property event
'SUMMARY
)
89 (icalendar--get-event-property event
'DESCRIPTION
)
90 (icalendar--get-event-property event
'LOCATION
)
91 (icalendar--get-event-property event
'ORGANIZER
)
92 (icalendar--get-event-property event
'STATUS
)
93 (icalendar--get-event-property event
'URL
)
94 (icalendar--get-event-property event
'CLASS
))))
95 (assert (string= (icalendar--format-ical-event event
)
96 "-sum-des-loc-org-nil-nil-nil-") t
)))
98 (defun icalendar-testsuite--test-parse-summary-and-rest ()
99 "Test `icalendar--parse-summary-and-rest'."
100 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
101 (icalendar-import-format-summary "SUM %s")
102 (icalendar-import-format-location " LOC %s")
103 (icalendar-import-format-description " DES %s")
104 (icalendar-import-format-organizer " ORG %s")
105 (icalendar-import-format-status " STA %s")
106 (icalendar-import-format-url " URL %s")
107 (icalendar-import-format-class " CLA %s")
109 (setq result
(icalendar--parse-summary-and-rest "SUM sum ORG org"))
110 (assert (string= (cdr (assoc 'org result
)) "org"))
112 (setq result
(icalendar--parse-summary-and-rest
113 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
114 (assert (string= (cdr (assoc 'des result
)) "des"))
115 (assert (string= (cdr (assoc 'loc result
)) "loc"))
116 (assert (string= (cdr (assoc 'org result
)) "org"))
117 (assert (string= (cdr (assoc 'sta result
)) "sta"))
118 (assert (string= (cdr (assoc 'cla result
)) "cla"))
120 (setq icalendar-import-format
(lambda () "Hello world"))
121 (setq result
(icalendar--parse-summary-and-rest
123 (assert (not result
))
126 (defun icalendar-testsuite--get-ical-event (ical-string)
127 "Helper function for testing `icalendar-testsuite--test-format-ical-event'.
128 Return icalendar event for ICAL-STRING."
132 (goto-char (point-min))
133 (car (icalendar--read-element nil nil
)))))
135 (defun icalendar-testsuite--test-import-format-sample ()
136 "Test method for `icalendar-import-format-sample'."
137 (assert (string= (icalendar-import-format-sample
138 (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
139 DTSTAMP:20030509T043439Z
140 DTSTART:20030509T103000
144 DTEND:20030509T153000
148 (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
149 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'"))))
151 (defun icalendar-testsuite--test-first-weekday-of-year ()
152 "Test method for `icalendar-first-weekday-of-year'."
153 (assert (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
154 (assert (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
155 (assert (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
156 (assert (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
157 (assert (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
158 (assert (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
159 (assert (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
160 (assert (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
161 (assert (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
163 (defun icalendar-testsuite--test-datestring-to-isodate ()
164 "Test method for `icalendar--datestring-to-isodate'."
165 (let ((calendar-date-style 'iso
))
167 (assert (string= (icalendar--datestring-to-isodate "2008 05 11")
169 (assert (string= (icalendar--datestring-to-isodate "2008 05 31")
171 (assert (string= (icalendar--datestring-to-isodate "2008 05 31" 2)
175 (setq calendar-date-style
'european
)
176 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
178 (assert (string= (icalendar--datestring-to-isodate "31 05 2008")
180 (assert (string= (icalendar--datestring-to-isodate "31 05 2008" 2)
184 (setq calendar-date-style
'american
)
185 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
187 (assert (string= (icalendar--datestring-to-isodate "12 30 2008")
189 (assert (string= (icalendar--datestring-to-isodate "12 30 2008" 2)
193 (setq calendar-date-style nil
) ;not necessary for conversion
194 (assert (string= (icalendar--datestring-to-isodate "Nov 05 2008")
196 (assert (string= (icalendar--datestring-to-isodate "05 Nov 2008")
198 (assert (string= (icalendar--datestring-to-isodate "2008 Nov 05")
201 (defun icalendar-testsuite--test-datetime-to-diary-date ()
202 "Test method for `icalendar--datetime-to-diary-date'."
203 (let* ((datetime '(59 59 23 31 12 2008))
204 (calendar-date-style 'iso
))
205 (assert (string= (icalendar--datetime-to-diary-date datetime
)
207 (setq calendar-date-style
'european
)
208 (assert (string= (icalendar--datetime-to-diary-date datetime
)
210 (setq calendar-date-style
'american
)
211 (assert (string= (icalendar--datetime-to-diary-date datetime
)
214 (defun icalendar-testsuite--test-diarytime-to-isotime ()
215 "Test method for `icalendar--diarytime-to-isotime'."
216 (assert (string= (icalendar--diarytime-to-isotime "0100" "")
218 (assert (string= (icalendar--diarytime-to-isotime "0100" "am")
220 (assert (string= (icalendar--diarytime-to-isotime "0100" "pm")
222 (assert (string= (icalendar--diarytime-to-isotime "1200" "")
224 (assert (string= (icalendar--diarytime-to-isotime "17:17" "")
226 (assert (string= (icalendar--diarytime-to-isotime "1200" "am")
228 (assert (string= (icalendar--diarytime-to-isotime "1201" "am")
230 (assert (string= (icalendar--diarytime-to-isotime "1259" "am")
232 (assert (string= (icalendar--diarytime-to-isotime "1200" "pm")
234 (assert (string= (icalendar--diarytime-to-isotime "1201" "pm")
236 (assert (string= (icalendar--diarytime-to-isotime "1259" "pm")
239 (defun icalendar-testsuite--test-calendar-style ()
240 "Test method for `icalendar--date-style'."
241 (dolist (calendar-date-style '(iso american european
))
242 (assert (eq (icalendar--date-style) calendar-date-style
)))
243 (let ((cds calendar-date-style
)
244 (european-calendar-style t
))
245 (makunbound 'calendar-date-style
)
246 (assert (eq (icalendar--date-style) 'european
))
247 (with-no-warnings (setq european-calendar-style nil
)) ;still get warning!?! FIXME
248 (assert (eq (icalendar--date-style) 'american
))
249 (setq calendar-date-style cds
)))
251 (defun icalendar-testsuite--test-create-uid ()
252 "Test method for `icalendar--create-uid'."
253 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
255 (icalendar--uid-count 77)
256 (entry-full "30.06.1964 07:01 blahblah")
257 (hash (format "%d" (abs (sxhash entry-full
))))
258 (contents "DTSTART:19640630T070100\nblahblah")
259 (username (or user-login-name
"UNKNOWN_USER"))
261 ;; FIXME! If a test fails 'current-time is screwed. FIXME!
262 (fset 't-ct
(symbol-function 'current-time
))
263 (fset 'current-time
(lambda () '(1 2 3)))
264 (assert (= 77 icalendar--uid-count
))
265 (assert (string= (concat "xxx-123-77-" hash
"-" username
"-19640630")
266 (icalendar--create-uid entry-full contents
)))
267 (assert (= 78 icalendar--uid-count
))
268 (fset 'current-time
(symbol-function 't-ct
))
270 (setq contents
"blahblah")
271 (setq icalendar-uid-format
"yyy%syyy")
272 (assert (string= (concat "yyyDTSTARTyyy")
273 (icalendar--create-uid entry-full contents
)))
276 (defun icalendar-testsuite--test-parse-vtimezone ()
277 (let (vtimezone result
)
278 (setq vtimezone
(icalendar-testsuite--get-ical-event "BEGIN:VTIMEZONE
281 DTSTART:16010101T040000
284 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
287 DTSTART:16010101T030000
290 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
294 (setq result
(icalendar--parse-vtimezone vtimezone
))
295 (assert (string= "thename" (car result
)))
296 (message (cdr result
))
297 (assert (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00" (cdr result
)))
298 (setq vtimezone
(icalendar-testsuite--get-ical-event "BEGIN:VTIMEZONE
301 DTSTART:16010101T040000
304 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
307 DTSTART:16010101T030000
310 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
314 (setq result
(icalendar--parse-vtimezone vtimezone
))
315 (assert (string= "anothername" (car result
)))
316 (message (cdr result
))
317 (assert (string= "STD-02:00DST-03:00,M3.2.1/03:00:00,M10.2.1/04:00:00" (cdr result
)))))
319 ;; ======================================================================
320 ;; Test methods for exporting from diary to icalendar
321 ;; ======================================================================
323 (defun icalendar-testsuite--test-export (input-iso input-european input-american
325 "Perform an export test.
326 Argument INPUT-ISO iso style diary string.
327 Argument INPUT-EUROPEAN european style diary string.
328 Argument INPUT-AMERICAN american style diary string.
329 Argument EXPECTED-OUTPUT expected icalendar result string.
331 European style input data must use german month names. American
332 and ISO style input data must use english month names."
333 (message "--- icalendar-testsuite--test-export ---")
334 (let ((calendar-date-style 'iso
)
335 (icalendar-recurring-start-year 2000))
336 (set-time-zone-rule "CET") ;;FIXME: reset timezone!
338 (let ((calendar-month-name-array
339 ["January" "February" "March" "April" "May" "June" "July" "August"
340 "September" "October" "November" "December"])
341 (calendar-day-name-array
342 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
344 (setq calendar-date-style
'iso
)
345 (icalendar-testsuite--do-test-export input-iso expected-output
)))
347 (let ((calendar-month-name-array
348 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
349 "September" "Oktober" "November" "Dezember"])
350 (calendar-day-name-array
351 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
353 (setq calendar-date-style
'european
)
354 (icalendar-testsuite--do-test-export input-european expected-output
)))
356 (let ((calendar-month-name-array
357 ["January" "February" "March" "April" "May" "June" "July" "August"
358 "September" "October" "November" "December"])
359 (calendar-day-name-array
360 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
362 (setq calendar-date-style
'american
)
363 (icalendar-testsuite--do-test-export input-american expected-output
)))))
365 (defun icalendar-testsuite--do-test-export (input expected-output
)
366 "Actually perform export test.
367 Argument INPUT input diary string.
368 Argument EXPECTED-OUTPUT expected icalendar result string."
369 (let ((temp-file (make-temp-file "icalendar-testsuite-ics")))
372 (icalendar-export-region (point-min) (point-max) temp-file
))
374 (find-file temp-file
)
375 (goto-char (point-min))
377 (cond (expected-output
378 (and (re-search-forward "^\\s-*BEGIN:VCALENDAR
379 PRODID:-//Emacs//NONSGML icalendar.el//EN
390 (regexp-quote (buffer-substring-no-properties
391 (match-beginning 1) (match-end 1)))
395 (re-search-forward "^\\s-*BEGIN:VCALENDAR
396 PRODID:-//Emacs//NONSGML icalendar.el//EN
402 "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s"
404 (or (and (match-beginning 1)
405 (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
407 (or expected-output
"<nil>"))))
408 (kill-buffer (find-buffer-visiting temp-file
))
409 (delete-file temp-file
)))
411 ;; ======================================================================
412 ;; Test methods for importing from icalendar to diary
413 ;; ======================================================================
415 (defun icalendar-testsuite--test-import (input expected-iso expected-european
417 "Perform import test.
418 Argument INPUT icalendar event string.
419 Argument EXPECTED-ISO expected iso style diary string.
420 Argument EXPECTED-EUROPEAN expected european style diary string.
421 Argument EXPECTED-AMERICAN expected american style diary string."
422 (message "--- icalendar-testsuite--test-import ---")
423 (let ((timezone (cadr (current-time-zone))))
424 (set-time-zone-rule "CET")
426 (if (string-match "^BEGIN:VCALENDAR" input
)
428 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
429 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
431 (unless (eq (char-before) ?
\n)
433 (insert "END:VEVENT\nEND:VCALENDAR\n"))
434 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
435 (icalendar-import-format-summary "%s")
436 (icalendar-import-format-location "\n Location: %s")
437 (icalendar-import-format-description "\n Desc: %s")
438 (icalendar-import-format-organizer "\n Organizer: %s")
439 (icalendar-import-format-status "\n Status: %s")
440 (icalendar-import-format-url "\n URL: %s")
441 (icalendar-import-format-class "\n Class: %s")
444 (setq calendar-date-style
'iso
)
445 (icalendar-testsuite--do-test-import input expected-iso
))
446 (when expected-european
447 (setq calendar-date-style
'european
)
448 (icalendar-testsuite--do-test-import input expected-european
))
449 (when expected-american
450 (setq calendar-date-style
'american
)
451 (icalendar-testsuite--do-test-import input expected-american
))))
452 (set-time-zone-rule timezone
)))
454 (defun icalendar-testsuite--do-test-import (input expected-output
)
455 "Actually perform import test.
456 Argument INPUT input icalendar string.
457 Argument EXPECTED-OUTPUT expected diary string."
458 (let ((temp-file (make-temp-file "icalendar-test-diary")))
459 (icalendar-import-buffer temp-file t t
)
461 (find-file temp-file
)
462 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
463 (unless (string-match (concat "^\\s-*" expected-output
"\\s-*$")
465 (error "Import test failed! Found `%s'\nbut expected `%s'" result
467 (kill-buffer (find-buffer-visiting temp-file
))
468 (delete-file temp-file
))))
470 ;; ======================================================================
471 ;; Test methods for cycle...
472 ;; ======================================================================
473 (defun icalendar-testsuite--test-cycle (input)
475 Argument INPUT icalendar event string."
477 (if (string-match "^BEGIN:VCALENDAR" input
)
479 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
480 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
482 (unless (eq (char-before) ?
\n)
484 (insert "END:VEVENT\nEND:VCALENDAR\n"))
485 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
486 (icalendar-import-format-summary "%s")
487 (icalendar-import-format-location "\n Location: %s")
488 (icalendar-import-format-description "\n Desc: %s")
489 (icalendar-import-format-organizer "\n Organizer: %s")
490 (icalendar-import-format-status "\n Status: %s")
491 (icalendar-import-format-url "\n URL: %s")
492 (icalendar-import-format-class "\n Class: %s"))
493 (dolist (calendar-date-style '(iso european american
))
494 (icalendar-testsuite--do-test-cycle)))))
496 (defun icalendar-testsuite--do-test-cycle ()
497 "Actually perform import/export cycle test."
498 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
499 (temp-ics (make-temp-file "icalendar-test-ics"))
500 (org-input (buffer-substring-no-properties (point-min) (point-max))))
503 (icalendar-import-buffer temp-diary t t
)
505 ;; step 2: export what was just imported
507 (find-file temp-diary
)
508 (icalendar-export-region (point-min) (point-max) temp-ics
))
510 ;; compare the output of step 2 with the input of step 1
513 (goto-char (point-min))
514 (when (re-search-forward "\nUID:.*\n" nil t
)
515 (replace-match "\n"))
516 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
517 (unless (string-equal org-input cycled
)
518 (error "Import test failed! Found `%s'\nbut expected `%s'" cycled
521 ;; clean up -- Note this is done only if test is passed
522 (kill-buffer (find-buffer-visiting temp-diary
))
524 (set-buffer (find-buffer-visiting temp-ics
))
525 (set-buffer-modified-p nil
)
526 (kill-buffer (current-buffer)))
527 (delete-file temp-diary
)
528 (delete-file temp-ics
)))
530 ;; ======================================================================
532 ;; ======================================================================
533 (defun icalendar-testsuite--run-import-tests ()
534 "Perform standard import tests."
535 (icalendar-testsuite--test-import
536 "SUMMARY:non-recurring
537 DTSTART;VALUE=DATE-TIME:20030919T090000
538 DTEND;VALUE=DATE-TIME:20030919T113000"
539 "&2003/9/19 09:00-11:30 non-recurring"
540 "&19/9/2003 09:00-11:30 non-recurring"
541 "&9/19/2003 09:00-11:30 non-recurring")
543 (icalendar-testsuite--test-import
544 "SUMMARY:non-recurring allday
545 DTSTART;VALUE=DATE-TIME:20030919"
546 "&2003/9/19 non-recurring allday"
547 "&19/9/2003 non-recurring allday"
548 "&9/19/2003 non-recurring allday")
550 (icalendar-testsuite--test-import
553 DTSTART;VALUE=DATE:20030919"
554 "&2003/9/19 long summary"
555 "&19/9/2003 long summary"
556 "&9/19/2003 long summary")
558 (icalendar-testsuite--test-import
559 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
563 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
564 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
565 DTSTART;VALUE=DATE:20040719
566 DTEND;VALUE=DATE:20040828
567 DTSTAMP:20031103T011641Z
569 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien"
570 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien"
571 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien")
573 (icalendar-testsuite--test-import
575 :04979712-3902-11d9-93dd-8f9f4afe08da
582 X-MOZILLA-ALARM-DEFAULT-LENGTH
593 "&2004/11/23 14:00-14:30 folded summary"
594 "&23/11/2004 14:00-14:30 folded summary"
595 "&11/23/2004 14:00-14:30 folded summary")
596 (icalendar-testsuite--test-import
598 :6161a312-3902-11d9-b512-f764153bb28b
605 X-MOZILLA-ALARM-DEFAULT-LENGTH
614 "&2004/11/23 14:45-15:45 another example"
615 "&23/11/2004 14:45-15:45 another example"
616 "&11/23/2004 14:45-15:45 another example")
618 (icalendar-testsuite--test-import
620 DTSTART;VALUE=DATE-TIME:20030919T090000
621 DTEND;VALUE=DATE-TIME:20030919T113000
624 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily"
625 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily"
626 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily")
629 (icalendar-testsuite--test-import
631 DTSTART;VALUE=DATE-TIME:20030919T090000
632 DTEND;VALUE=DATE-TIME:20030919T113000
633 RRULE:FREQ=DAILY;INTERVAL=2
635 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily"
636 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily"
637 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily")
638 (icalendar-testsuite--test-import
639 "SUMMARY:rrule daily with exceptions
640 DTSTART;VALUE=DATE-TIME:20030919T090000
641 DTEND;VALUE=DATE-TIME:20030919T113000
642 RRULE:FREQ=DAILY;INTERVAL=2
643 EXDATE:20030921,20030925
645 "&%%(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"
646 "&%%(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"
647 "&%%(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")
649 (icalendar-testsuite--test-import
650 "SUMMARY:rrule weekly
651 DTSTART;VALUE=DATE-TIME:20030919T090000
652 DTEND;VALUE=DATE-TIME:20030919T113000
655 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly"
656 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly"
657 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly")
658 (icalendar-testsuite--test-import
659 "SUMMARY:rrule monthly no end
660 DTSTART;VALUE=DATE-TIME:20030919T090000
661 DTEND;VALUE=DATE-TIME:20030919T113000
664 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end"
665 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end"
666 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end")
667 (icalendar-testsuite--test-import
668 "SUMMARY:rrule monthly with end
669 DTSTART;VALUE=DATE-TIME:20030919T090000
670 DTEND;VALUE=DATE-TIME:20030919T113000
671 RRULE:FREQ=MONTHLY;UNTIL=20050819;
673 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end"
674 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end"
675 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end")
676 (icalendar-testsuite--test-import
677 "DTSTART;VALUE=DATE:20040815
678 DTEND;VALUE=DATE:20040816
679 SUMMARY:Maria Himmelfahrt
680 UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
681 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
683 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt"
684 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt"
685 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt")
686 (icalendar-testsuite--test-import
687 "SUMMARY:rrule yearly
688 DTSTART;VALUE=DATE-TIME:20030919T090000
689 DTEND;VALUE=DATE-TIME:20030919T113000
690 RRULE:FREQ=YEARLY;INTERVAL=2
692 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly" ;FIXME
693 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME
694 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME
695 (icalendar-testsuite--test-import
696 "SUMMARY:rrule count daily short
697 DTSTART;VALUE=DATE-TIME:20030919T090000
698 DTEND;VALUE=DATE-TIME:20030919T113000
699 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
701 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short"
702 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short"
703 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short")
704 (icalendar-testsuite--test-import
705 "SUMMARY:rrule count daily long
706 DTSTART;VALUE=DATE-TIME:20030919T090000
707 DTEND;VALUE=DATE-TIME:20030919T113000
708 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
710 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long"
711 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long"
712 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long")
713 (icalendar-testsuite--test-import
714 "SUMMARY:rrule count bi-weekly 3 times
715 DTSTART;VALUE=DATE-TIME:20030919T090000
716 DTEND;VALUE=DATE-TIME:20030919T113000
717 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
719 "&%%(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"
720 "&%%(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"
721 "&%%(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")
722 (icalendar-testsuite--test-import
723 "SUMMARY:rrule count monthly
724 DTSTART;VALUE=DATE-TIME:20030919T090000
725 DTEND;VALUE=DATE-TIME:20030919T113000
726 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
728 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly"
729 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly"
730 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly")
731 (icalendar-testsuite--test-import
732 "SUMMARY:rrule count every second month
733 DTSTART;VALUE=DATE-TIME:20030919T090000
734 DTEND;VALUE=DATE-TIME:20030919T113000
735 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
737 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month" ;FIXME
738 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME
739 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME
740 (icalendar-testsuite--test-import
741 "SUMMARY:rrule count yearly
742 DTSTART;VALUE=DATE-TIME:20030919T090000
743 DTEND;VALUE=DATE-TIME:20030919T113000
744 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
746 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly"
747 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly"
748 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly")
749 (icalendar-testsuite--test-import
750 "SUMMARY:rrule count every second year
751 DTSTART;VALUE=DATE-TIME:20030919T090000
752 DTEND;VALUE=DATE-TIME:20030919T113000
753 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
755 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year" ;FIXME!!!
756 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!!
757 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!!
760 (icalendar-testsuite--test-import
761 "DTSTART;VALUE=DATE:20050217
765 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration"
766 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration"
767 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration")
769 (icalendar-testsuite--test-import
770 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
771 DTSTAMP:20041127T183315Z
772 LAST-MODIFIED:20041127T183329
774 DTSTART;VALUE=DATE:20011221
775 DTEND;VALUE=DATE:20011221
776 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
779 CREATED:20041127T183329
781 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub"
782 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub"
783 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub")
786 ;; ======================================================================
788 ;; ======================================================================
789 (defun icalendar-testsuite--run-export-tests ()
790 "Perform standard export tests."
792 (let ((icalendar-export-hidden-diary-entries nil
))
793 (icalendar-testsuite--test-export
794 "&2000 Oct 3 ordinary no time "
795 "&3 Okt 2000 ordinary no time "
796 "&Oct 3 2000 ordinary no time "
800 (icalendar-testsuite--test-export
801 "2000 Oct 3 ordinary no time "
802 "3 Okt 2000 ordinary no time "
803 "Oct 3 2000 ordinary no time "
804 "DTSTART;VALUE=DATE:20001003
805 DTEND;VALUE=DATE:20001004
806 SUMMARY:ordinary no time
808 (icalendar-testsuite--test-export
809 "2000 Oct 3 16:30 ordinary with time"
810 "3 Okt 2000 16:30 ordinary with time"
811 "Oct 3 2000 16:30 ordinary with time"
812 "DTSTART;VALUE=DATE-TIME:20001003T163000
813 DTEND;VALUE=DATE-TIME:20001003T173000
814 SUMMARY:ordinary with time
816 (icalendar-testsuite--test-export
817 "2000 10 3 16:30 ordinary with time 2"
818 "3 10 2000 16:30 ordinary with time 2"
819 "10 3 2000 16:30 ordinary with time 2"
820 "DTSTART;VALUE=DATE-TIME:20001003T163000
821 DTEND;VALUE=DATE-TIME:20001003T173000
822 SUMMARY:ordinary with time 2
825 (icalendar-testsuite--test-export
826 "2000/10/3 16:30 ordinary with time 3"
827 "3/10/2000 16:30 ordinary with time 3"
828 "10/3/2000 16:30 ordinary with time 3"
829 "DTSTART;VALUE=DATE-TIME:20001003T163000
830 DTEND;VALUE=DATE-TIME:20001003T173000
831 SUMMARY:ordinary with time 3
834 ;; multiline -- FIXME!!!
835 (icalendar-testsuite--test-export
836 "2000 October 3 16:30 multiline
837 17:30 multiline continued FIXME"
838 "3 Oktober 2000 16:30 multiline
839 17:30 multiline continued FIXME"
840 "October 3 2000 16:30 multiline
841 17:30 multiline continued FIXME"
842 "DTSTART;VALUE=DATE-TIME:20001003T163000
843 DTEND;VALUE=DATE-TIME:20001003T173000
846 17:30 multiline continued FIXME
850 (icalendar-testsuite--test-export
851 "Monday 1:30pm weekly by day with start time"
852 "Montag 13:30 weekly by day with start time"
853 "Monday 1:30pm weekly by day with start time"
854 "DTSTART;VALUE=DATE-TIME:20000103T133000
855 DTEND;VALUE=DATE-TIME:20000103T143000
856 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
857 SUMMARY:weekly by day with start time
860 (icalendar-testsuite--test-export
861 "Monday 13:30-15:00 weekly by day with start and end time"
862 "Montag 13:30-15:00 weekly by day with start and end time"
863 "Monday 01:30pm-03:00pm weekly by day with start and end time"
864 "DTSTART;VALUE=DATE-TIME:20000103T133000
865 DTEND;VALUE=DATE-TIME:20000103T150000
866 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
867 SUMMARY:weekly by day with start and end time
871 (icalendar-testsuite--test-export
872 "may 1 yearly no time"
873 "1 Mai yearly no time"
874 "may 1 yearly no time"
875 "DTSTART;VALUE=DATE:19000501
876 DTEND;VALUE=DATE:19000502
877 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
878 SUMMARY:yearly no time
882 (icalendar-testsuite--test-export
883 "%%(diary-anniversary 1989 10 3) anniversary no time"
884 "%%(diary-anniversary 3 10 1989) anniversary no time"
885 "%%(diary-anniversary 10 3 1989) anniversary no time"
886 "DTSTART;VALUE=DATE:19891003
887 DTEND;VALUE=DATE:19891004
888 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
889 SUMMARY:anniversary no time
891 (icalendar-testsuite--test-export
892 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
893 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
894 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
895 "DTSTART;VALUE=DATE-TIME:19891003T190000
896 DTEND;VALUE=DATE-TIME:19891004T200000
897 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
898 SUMMARY:anniversary with time
902 (icalendar-testsuite--test-export
903 "%%(diary-block 2001 6 18 2001 7 6) block no time"
904 "%%(diary-block 18 6 2001 6 7 2001) block no time"
905 "%%(diary-block 6 18 2001 7 6 2001) block no time"
906 "DTSTART;VALUE=DATE:20010618
907 DTEND;VALUE=DATE:20010707
908 SUMMARY:block no time
910 (icalendar-testsuite--test-export
911 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
912 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
913 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
914 "DTSTART;VALUE=DATE-TIME:20010618T130000
915 DTEND;VALUE=DATE-TIME:20010618T170000
916 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
917 SUMMARY:block with time
919 (icalendar-testsuite--test-export
920 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
921 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
922 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
923 "DTSTART;VALUE=DATE-TIME:20010618T130000
924 DTEND;VALUE=DATE-TIME:20010618T140000
925 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
926 SUMMARY:block no end time
930 ;; ======================================================================
932 ;; ======================================================================
933 (defun icalendar-testsuite--run-real-world-tests ()
934 "Perform real-world tests, as gathered from problem reports."
936 (icalendar-testsuite--test-import
939 PRODID:Microsoft CDO for Microsoft Exchange
942 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
943 X-MICROSOFT-CDO-TZID:23
945 DTSTART:16010101T000000
950 DTSTART:16010101T000000
956 DTSTAMP:20030509T043439Z
957 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
958 SUMMARY:On-Site Interview
959 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
960 010000000DB823520692542408ED02D7023F9DFF9
961 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
962 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
963 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
964 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
965 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
966 zz\":MAILTO:zzzzzz@zzzzzzz.com
967 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
969 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
970 DESCRIPTION:10:30am - Blah
974 CREATED:20030509T043439Z
975 LAST-MODIFIED:20030509T043459Z
978 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
979 X-MICROSOFT-CDO-INSTTYPE:0
980 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
981 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
982 X-MICROSOFT-CDO-IMPORTANCE:1
983 X-MICROSOFT-CDO-OWNERAPPTID:126441427
987 TRIGGER;RELATED=START:-PT00H15M00S
992 "&9/5/2003 10:30-15:30 On-Site Interview
995 Organizer: MAILTO:aaaaaaa@aaaaaaa.com"
996 "&5/9/2003 10:30-15:30 On-Site Interview
999 Organizer: MAILTO:aaaaaaa@aaaaaaa.com")
1002 (icalendar-testsuite--test-import
1003 "DTSTAMP:20030618T195512Z
1004 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1005 SUMMARY:Dress Rehearsal for XXXX-XXXX
1006 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1007 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1008 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1009 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1010 ORGANIZER;CN=\"ABCD,TECHTRAINING
1011 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1012 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1013 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1014 DESCRIPTION:753 Zeichen hier radiert
1018 CREATED:20030618T195518Z
1019 LAST-MODIFIED:20030618T195527Z
1022 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1023 X-MICROSOFT-CDO-INSTTYPE:0
1024 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1025 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1026 X-MICROSOFT-CDO-IMPORTANCE:1
1027 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1030 DESCRIPTION:REMINDER
1031 TRIGGER;RELATED=START:-PT00H15M00S
1034 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1035 Desc: 753 Zeichen hier radiert
1036 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1037 Organizer: MAILTO:xxx@xxxxx.com"
1038 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1039 Desc: 753 Zeichen hier radiert
1040 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1041 Organizer: MAILTO:xxx@xxxxx.com")
1043 ;; 2003-06-18 b -- uses timezone
1044 (icalendar-testsuite--test-import
1047 PRODID:Microsoft CDO for Microsoft Exchange
1050 TZID:Mountain Time (US & Canada)
1051 X-MICROSOFT-CDO-TZID:12
1053 DTSTART:16010101T020000
1056 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1059 DTSTART:16010101T020000
1062 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1066 DTSTAMP:20030618T230323Z
1067 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1068 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1069 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1070 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1071 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1072 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1073 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1075 ORGANIZER;CN=\"ABCD,TECHTRAINING
1076 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1077 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1078 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1079 DESCRIPTION:Viele Zeichen standen hier früher
1083 CREATED:20030618T230326Z
1084 LAST-MODIFIED:20030618T230335Z
1087 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1088 X-MICROSOFT-CDO-INSTTYPE:0
1089 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1090 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1091 X-MICROSOFT-CDO-IMPORTANCE:1
1092 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1095 DESCRIPTION:REMINDER
1096 TRIGGER;RELATED=START:-PT00H15M00S
1101 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1102 Desc: Viele Zeichen standen hier früher
1103 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1104 Organizer: MAILTO:bbb@bbbbb.com
1106 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1107 Desc: Viele Zeichen standen hier früher
1108 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1109 Organizer: MAILTO:bbb@bbbbb.com
1112 ;; export 2004-10-28 block entries
1113 (icalendar-testsuite--test-export
1116 "-*- mode: text; fill-column: 256;-*-
1120 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1122 "DTSTART;VALUE=DATE:20041108
1123 DTEND;VALUE=DATE:20041111
1124 SUMMARY:Nov 8-10 aa")
1126 (icalendar-testsuite--test-export
1129 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1130 "DTSTART;VALUE=DATE:20041213
1131 DTEND;VALUE=DATE:20041218
1132 SUMMARY:Dec 13-17 bb")
1134 (icalendar-testsuite--test-export
1137 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1138 "DTSTART;VALUE=DATE:20050203
1139 DTEND;VALUE=DATE:20050205
1140 SUMMARY:Feb 3-4 cc")
1142 (icalendar-testsuite--test-export
1145 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1146 "DTSTART;VALUE=DATE:20050424
1147 DTEND;VALUE=DATE:20050430
1148 SUMMARY:April 24-29 dd
1150 (icalendar-testsuite--test-export
1153 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1154 "DTSTART;VALUE=DATE:20050530
1155 DTEND;VALUE=DATE:20050602
1156 SUMMARY:may 30 - June 1: ee")
1158 (icalendar-testsuite--test-export
1161 "%%(diary-block 6 6 2005 6 8 2005) ff"
1162 "DTSTART;VALUE=DATE:20050606
1163 DTEND;VALUE=DATE:20050609
1166 ;; export 2004-10-28 anniversary entries
1167 (icalendar-testsuite--test-export
1173 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1174 "DTSTART;VALUE=DATE:19910328
1175 DTEND;VALUE=DATE:19910329
1176 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1177 SUMMARY:aa birthday (%d years old)
1180 (icalendar-testsuite--test-export
1183 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1184 "DTSTART;VALUE=DATE:19570517
1185 DTEND;VALUE=DATE:19570518
1186 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1187 SUMMARY:bb birthday (%d years old)")
1189 (icalendar-testsuite--test-export
1192 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1193 "DTSTART;VALUE=DATE:19970608
1194 DTEND;VALUE=DATE:19970609
1195 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1196 SUMMARY:cc birthday (%d years old)")
1198 (icalendar-testsuite--test-export
1201 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1202 "DTSTART;VALUE=DATE:19830722
1203 DTEND;VALUE=DATE:19830723
1204 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1205 SUMMARY:dd (%d years ago...!)")
1207 (icalendar-testsuite--test-export
1210 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1211 "DTSTART;VALUE=DATE:19880801
1212 DTEND;VALUE=DATE:19880802
1213 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1214 SUMMARY:ee birthday (%d years old)")
1216 (icalendar-testsuite--test-export
1219 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1220 "DTSTART;VALUE=DATE:19570921
1221 DTEND;VALUE=DATE:19570922
1222 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1223 SUMMARY:ff birthday (%d years old)")
1228 ;; export 2004-10-28 monthly, weekly entries
1230 ;; (icalendar-testsuite--test-export
1233 ;; >>> ------------ monthly:
1235 ;; */27/* 10:00 blah blah"
1238 (icalendar-testsuite--test-export
1241 ">>> ------------ my week:
1244 "DTSTART;VALUE=DATE-TIME:20000103T130000
1245 DTEND;VALUE=DATE-TIME:20000103T140000
1246 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1249 (icalendar-testsuite--test-export
1253 "DTSTART;VALUE=DATE-TIME:20000103T150000
1254 DTEND;VALUE=DATE-TIME:20000103T160000
1255 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1259 (icalendar-testsuite--test-export
1262 "Monday 16:00-17:00 a2"
1263 "DTSTART;VALUE=DATE-TIME:20000103T160000
1264 DTEND;VALUE=DATE-TIME:20000103T170000
1265 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1268 (icalendar-testsuite--test-export
1271 "Tuesday 11:30-13:00 a3"
1272 "DTSTART;VALUE=DATE-TIME:20000104T113000
1273 DTEND;VALUE=DATE-TIME:20000104T130000
1274 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1277 (icalendar-testsuite--test-export
1281 "DTSTART;VALUE=DATE-TIME:20000104T150000
1282 DTEND;VALUE=DATE-TIME:20000104T160000
1283 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1286 (icalendar-testsuite--test-export
1289 "Wednesday 13:00 a5"
1290 "DTSTART;VALUE=DATE-TIME:20000105T130000
1291 DTEND;VALUE=DATE-TIME:20000105T140000
1292 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1295 (icalendar-testsuite--test-export
1298 "Wednesday 11:30-13:30 a6"
1299 "DTSTART;VALUE=DATE-TIME:20000105T113000
1300 DTEND;VALUE=DATE-TIME:20000105T133000
1301 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1304 (icalendar-testsuite--test-export
1307 "Wednesday 15:00 s1"
1308 "DTSTART;VALUE=DATE-TIME:20000105T150000
1309 DTEND;VALUE=DATE-TIME:20000105T160000
1310 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1314 ;; export 2004-10-28 regular entries
1315 (icalendar-testsuite--test-export
1319 >>> regular diary entries:
1321 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1322 "DTSTART;VALUE=DATE-TIME:20041012T140000
1323 DTEND;VALUE=DATE-TIME:20041012T150000
1324 SUMMARY:Tue: [2004-10-12] q1")
1327 (icalendar-testsuite--test-import
1332 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1335 :04979712-3902-11d9-93dd-8f9f4afe08da
1342 X-MOZILLA-ALARM-DEFAULT-LENGTH
1355 :6161a312-3902-11d9-b512-f764153bb28b
1362 X-MOZILLA-ALARM-DEFAULT-LENGTH
1373 :943a4d7e-3902-11d9-9ce7-c9addeadf928
1380 X-MOZILLA-ALARM-DEFAULT-LENGTH
1391 :fe53615e-3902-11d9-9dd8-9d38a155bf41
1398 X-MOZILLA-ALARM-DEFAULT-LENGTH
1400 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1403 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1413 :87c928ee-3901-11d9-b21f-b45042155024
1415 :Rrrr/Cccccc ii Aaaaaaaa
1417 :Vvvvv Rrrr aaa Cccccc
1422 X-MOZILLA-ALARM-DEFAULT-LENGTH
1437 :e8f331ae-3902-11d9-9948-dfdcb66a2872
1444 X-MOZILLA-ALARM-DEFAULT-LENGTH
1447 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1462 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1465 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1468 &23/11/2004 11:00-12:00 Hhhhhhhh
1471 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1474 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1475 Desc: Vvvvv Rrrr aaa Cccccc
1478 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1481 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1484 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1487 &11/23/2004 11:00-12:00 Hhhhhhhh
1490 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1493 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1494 Desc: Vvvvv Rrrr aaa Cccccc
1497 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1502 (icalendar-testsuite--test-export
1503 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1506 "DTSTART;VALUE=DATE:20040101
1507 DTEND;VALUE=DATE:20040105
1511 (icalendar-testsuite--test-export
1513 "5 11 2004 Bla Fasel"
1515 "DTSTART;VALUE=DATE:20041105
1516 DTEND;VALUE=DATE:20041106
1520 (icalendar-testsuite--test-export
1522 "2 Nov 2004 15:00-16:30 Zahnarzt"
1524 "DTSTART;VALUE=DATE-TIME:20041102T150000
1525 DTEND;VALUE=DATE-TIME:20041102T163000
1529 (icalendar-testsuite--test-import
1531 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1551 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1553 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1557 (icalendar-testsuite--test-import
1558 "DTSTART;VALUE=DATE:20050217
1559 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1560 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1561 DTSTAMP:20050118T210335Z
1564 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa"
1565 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa")
1568 (icalendar-testsuite--test-export
1570 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1572 "DTSTART;VALUE=DATE-TIME:20050208T160000
1573 DTEND;VALUE=DATE-TIME:20050208T164500
1574 RRULE:FREQ=DAILY;INTERVAL=7
1579 (icalendar-testsuite--test-export
1582 ;; FIXME: colon not allowed!
1583 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1584 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1585 "DTSTART;VALUE=DATE:19001101
1586 DTEND;VALUE=DATE:19001102
1587 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1588 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1592 (defun icalendar-testsuite--run-cycle-tests ()
1593 "Perform cycling tests."
1594 (icalendar-testsuite--test-cycle
1595 "DTSTART;VALUE=DATE-TIME:20030919T090000
1596 DTEND;VALUE=DATE-TIME:20030919T113000
1600 (icalendar-testsuite--test-cycle
1601 "DTSTART;VALUE=DATE-TIME:20030919T090000
1602 DTEND;VALUE=DATE-TIME:20030919T113000
1604 DESCRIPTION:beschreibung!
1609 (icalendar-testsuite--test-cycle
1610 "DTSTART;VALUE=DATE:19190909
1611 DTEND;VALUE=DATE:19190910
1612 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1613 SUMMARY:and diary-anniversary
1618 (provide 'icalendar-testsuite
)
1620 ;; arch-tag: 33a98396-90e9-49c8-b0e9-b606386d6e8c
1621 ;;; icalendar-testsuite.el ends here