(Fdefmacro): Doc fix.
[emacs.git] / test / icalendar-testsuite.el
blobfcfef918ad6a3cfde56e8049fa6188d55a383c6b
1 ;; icalendar-testsuite.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008 Free Software Foundation, Inc.
5 ;; Author: Ulf Jasper <ulf.jasper@web.de>
6 ;; Created: March 2005
7 ;; Keywords: calendar
8 ;; Human-Keywords: calendar, diary, iCalendar, vCalendar
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Commentary:
27 ;; TODO:
28 ;; - Add more unit tests for functions, timezone etc.
30 ;; Note: Watch the trailing blank that is added on import.
32 ;;; Code:
33 (defun icalendar-testsuite-run ()
34 "Run icalendar test suite."
35 (interactive)
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-calendar-style))
56 (defun icalendar-testsuite--test-format-ical-event ()
57 "Test `icalendar--format-ical-event'."
58 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
59 (icalendar-import-format-summary "SUM %s")
60 (icalendar-import-format-location " LOC %s")
61 (icalendar-import-format-description " DES %s")
62 (icalendar-import-format-organizer " ORG %s")
63 (icalendar-import-format-status " STA %s")
64 (icalendar-import-format-url " URL %s")
65 (icalendar-import-format-class " CLA %s")
66 (event (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
67 DTSTAMP:20030509T043439Z
68 DTSTART:20030509T103000
69 SUMMARY:sum
70 ORGANIZER:org
71 LOCATION:loc
72 DTEND:20030509T153000
73 DESCRIPTION:des
74 END:VEVENT
75 ")))
76 (assert (string= (icalendar--format-ical-event event)
77 "SUM sum DES des LOC loc ORG org") t)
78 (setq icalendar-import-format (lambda (&rest ignore)
79 "helloworld"))
80 (assert (string= (icalendar--format-ical-event event)
81 "helloworld") t)
82 (setq icalendar-import-format
83 (lambda (e)
84 (format "-%s-%s-%s-%s-%s-%s-%s-"
85 (icalendar--get-event-property event 'SUMMARY)
86 (icalendar--get-event-property event 'DESCRIPTION)
87 (icalendar--get-event-property event 'LOCATION)
88 (icalendar--get-event-property event 'ORGANIZER)
89 (icalendar--get-event-property event 'STATUS)
90 (icalendar--get-event-property event 'URL)
91 (icalendar--get-event-property event 'CLASS))))
92 (assert (string= (icalendar--format-ical-event event)
93 "-sum-des-loc-org-nil-nil-nil-") t)))
95 (defun icalendar-testsuite--test-parse-summary-and-rest ()
96 "Test `icalendar--parse-summary-and-rest'."
97 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
98 (icalendar-import-format-summary "SUM %s")
99 (icalendar-import-format-location " LOC %s")
100 (icalendar-import-format-description " DES %s")
101 (icalendar-import-format-organizer " ORG %s")
102 (icalendar-import-format-status " STA %s")
103 (icalendar-import-format-url " URL %s")
104 (icalendar-import-format-class " CLA %s")
105 (result))
106 ;; FIXME: need a trailing blank char!
107 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org "))
108 (assert (string= (cdr (assoc 'org result)) "org"))
110 (setq result (icalendar--parse-summary-and-rest
111 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla "))
112 (assert (string= (cdr (assoc 'des result)) "des"))
113 (assert (string= (cdr (assoc 'loc result)) "loc"))
114 (assert (string= (cdr (assoc 'org result)) "org"))
115 (assert (string= (cdr (assoc 'sta result)) "sta"))
116 (assert (string= (cdr (assoc 'cla result)) "cla"))
118 (setq icalendar-import-format (lambda () "Hello world"))
119 (setq result (icalendar--parse-summary-and-rest
120 "blah blah "))
121 (assert (not result))
124 (defun icalendar-testsuite--get-ical-event (ical-string)
125 "Helper function for testing `icalendar-testsuite--test-format-ical-event'.
126 Return icalendar event for ICAL-STRING."
127 (save-excursion
128 (with-temp-buffer
129 (insert ical-string)
130 (goto-char (point-min))
131 (car (icalendar--read-element nil nil)))))
133 (defun icalendar-testsuite--test-import-format-sample ()
134 "Test method for `icalendar-import-format-sample'."
135 (assert (string= (icalendar-import-format-sample
136 (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
137 DTSTAMP:20030509T043439Z
138 DTSTART:20030509T103000
139 SUMMARY:a
140 ORGANIZER:d
141 LOCATION:c
142 DTEND:20030509T153000
143 DESCRIPTION:b
144 END:VEVENT
146 (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
147 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'"))))
149 (defun icalendar-testsuite--test-first-weekday-of-year ()
150 "Test method for `icalendar-first-weekday-of-year'."
151 (assert (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
152 (assert (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
153 (assert (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
154 (assert (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
155 (assert (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
156 (assert (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
157 (assert (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
158 (assert (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
159 (assert (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
161 (defun icalendar-testsuite--test-datestring-to-isodate ()
162 "Test method for `icalendar--datestring-to-isodate'."
163 (let ((calendar-date-style 'iso))
164 ;; numeric iso
165 (assert (string= (icalendar--datestring-to-isodate "2008 05 11")
166 "20080511"))
167 (assert (string= (icalendar--datestring-to-isodate "2008 05 31")
168 "20080531"))
169 (assert (string= (icalendar--datestring-to-isodate "2008 05 31" 2)
170 "20080602"))
172 ;; numeric european
173 (setq calendar-date-style 'european)
174 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
175 "20080511"))
176 (assert (string= (icalendar--datestring-to-isodate "31 05 2008")
177 "20080531"))
178 (assert (string= (icalendar--datestring-to-isodate "31 05 2008" 2)
179 "20080602"))
181 ;; numeric american
182 (setq calendar-date-style 'american)
183 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
184 "20081105"))
185 (assert (string= (icalendar--datestring-to-isodate "12 30 2008")
186 "20081230"))
187 (assert (string= (icalendar--datestring-to-isodate "12 30 2008" 2)
188 "20090101"))
190 ;; non-numeric
191 (setq calendar-date-style nil) ;not necessary for conversion
192 (assert (string= (icalendar--datestring-to-isodate "Nov 05 2008")
193 "20081105"))
194 (assert (string= (icalendar--datestring-to-isodate "05 Nov 2008")
195 "20081105"))
196 (assert (string= (icalendar--datestring-to-isodate "2008 Nov 05")
197 "20081105"))))
199 (defun icalendar-testsuite--test-datetime-to-diary-date ()
200 "Test method for `icalendar--datetime-to-diary-date'."
201 (let* ((datetime '(59 59 23 31 12 2008))
202 (calendar-date-style 'iso))
203 (assert (string= (icalendar--datetime-to-diary-date datetime)
204 "2008 12 31"))
205 (setq calendar-date-style 'european)
206 (assert (string= (icalendar--datetime-to-diary-date datetime)
207 "31 12 2008"))
208 (setq calendar-date-style 'american)
209 (assert (string= (icalendar--datetime-to-diary-date datetime)
210 "12 31 2008"))))
212 (defun icalendar-testsuite--test-calendar-style ()
213 "Test method for `icalendar--date-style'."
214 (dolist (calendar-date-style '(iso american european))
215 (assert (eq (icalendar--date-style) calendar-date-style)))
216 (let ((cds calendar-date-style)
217 (european-calendar-style t))
218 (makunbound 'calendar-date-style)
219 (assert (eq (icalendar--date-style) 'european))
220 (with-no-warnings (setq european-calendar-style nil)) ;still get warning!?! FIXME
221 (assert (eq (icalendar--date-style) 'american))
222 (setq calendar-date-style cds)))
224 ;; ======================================================================
225 ;; Test methods for exporting from diary to icalendar
226 ;; ======================================================================
228 (defun icalendar-testsuite--test-export (input-iso input-european input-american
229 expected-output)
230 "Perform an export test.
231 Argument INPUT-ISO iso style diary string.
232 Argument INPUT-EUROPEAN european style diary string.
233 Argument INPUT-AMERICAN american style diary string.
234 Argument EXPECTED-OUTPUT expected icalendar result string.
236 European style input data must use german month names. American
237 and ISO style input data must use english month names."
238 (message "--- icalendar-testsuite--test-export ---")
239 (let ((calendar-date-style 'iso)
240 (icalendar-recurring-start-year 2000))
241 (set-time-zone-rule "CET") ;;FIXME: reset timezone!
242 (when input-iso
243 (let ((calendar-month-name-array
244 ["January" "February" "March" "April" "May" "June" "July" "August"
245 "September" "October" "November" "December"])
246 (calendar-day-name-array
247 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
248 "Saturday"]))
249 (setq calendar-date-style 'iso)
250 (icalendar-testsuite--do-test-export input-iso expected-output)))
251 (when input-european
252 (let ((calendar-month-name-array
253 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
254 "September" "Oktober" "November" "Dezember"])
255 (calendar-day-name-array
256 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
257 "Samstag"]))
258 (setq calendar-date-style 'european)
259 (icalendar-testsuite--do-test-export input-european expected-output)))
260 (when input-american
261 (let ((calendar-month-name-array
262 ["January" "February" "March" "April" "May" "June" "July" "August"
263 "September" "October" "November" "December"])
264 (calendar-day-name-array
265 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
266 "Saturday"]))
267 (setq calendar-date-style 'american)
268 (icalendar-testsuite--do-test-export input-american expected-output)))))
270 (defun icalendar-testsuite--do-test-export (input expected-output)
271 "Actually perform export test.
272 Argument INPUT input diary string.
273 Argument EXPECTED-OUTPUT expected icalendar result string."
274 (let ((temp-file (make-temp-file "icalendar-testsuite-ics")))
275 (with-temp-buffer
276 (insert input)
277 (icalendar-export-region (point-min) (point-max) temp-file))
278 (save-excursion
279 (find-file temp-file)
280 (goto-char (point-min))
281 (unless
282 (cond (expected-output
283 (and (re-search-forward "^\\s-*BEGIN:VCALENDAR
284 PRODID:-//Emacs//NONSGML icalendar.el//EN
285 VERSION:2.0
286 BEGIN:VEVENT
287 UID:emacs[0-9]+
288 \\(\\(.\\|\n\\)+\\)
289 END:VEVENT
290 END:VCALENDAR
291 \\s-*$"
292 nil t)
293 (string-match
294 (concat "^\\s-*"
295 (regexp-quote (buffer-substring-no-properties
296 (match-beginning 1) (match-end 1)))
297 "\\s-*$")
298 expected-output)))
300 (re-search-forward "^\\s-*BEGIN:VCALENDAR
301 PRODID:-//Emacs//NONSGML icalendar.el//EN
302 VERSION:2.0
303 END:VCALENDAR
304 \\s-*$"
305 nil t)))
306 (error
307 "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s"
308 input
309 (or (and (match-beginning 1)
310 (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
311 "<nil>")
312 (or expected-output "<nil>"))))
313 (kill-buffer (find-buffer-visiting temp-file))
314 (delete-file temp-file)))
316 ;; ======================================================================
317 ;; Test methods for importing from icalendar to diary
318 ;; ======================================================================
320 (defun icalendar-testsuite--test-import (input expected-iso expected-european
321 expected-american)
322 "Perform import test.
323 Argument INPUT icalendar event string.
324 Argument EXPECTED-ISO expected iso style diary string.
325 Argument EXPECTED-EUROPEAN expected european style diary string.
326 Argument EXPECTED-AMERICAN expected american style diary string."
327 (message "--- icalendar-testsuite--test-import ---")
328 (let ((timezone (cadr (current-time-zone))))
329 (set-time-zone-rule "CET")
330 (with-temp-buffer
331 (if (string-match "^BEGIN:VCALENDAR" input)
332 (insert input)
333 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
334 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
335 (insert input)
336 (unless (eq (char-before) ?\n)
337 (insert "\n"))
338 (insert "END:VEVENT\nEND:VCALENDAR\n"))
339 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
340 (icalendar-import-format-summary "%s")
341 (icalendar-import-format-location "\n Location: %s")
342 (icalendar-import-format-description "\n Desc: %s")
343 (icalendar-import-format-organizer "\n Organizer: %s")
344 (icalendar-import-format-status "\n Status: %s")
345 (icalendar-import-format-url "\n URL: %s")
346 (icalendar-import-format-class "\n Class: %s")
347 calendar-date-style)
348 (when expected-iso
349 (setq calendar-date-style 'iso)
350 (icalendar-testsuite--do-test-import input expected-iso))
351 (when expected-european
352 (setq calendar-date-style 'european)
353 (icalendar-testsuite--do-test-import input expected-european))
354 (when expected-american
355 (setq calendar-date-style 'american)
356 (icalendar-testsuite--do-test-import input expected-american))))
357 (set-time-zone-rule timezone)))
359 (defun icalendar-testsuite--do-test-import (input expected-output)
360 "Actually perform import test.
361 Argument INPUT input icalendar string.
362 Argument EXPECTED-OUTPUT expected diary string."
363 (let ((temp-file (make-temp-file "icalendar-test-diary")))
364 (icalendar-import-buffer temp-file t t)
365 (save-excursion
366 (find-file temp-file)
367 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
368 (unless (string-match (concat "^\\s-*" expected-output "\\s-*$")
369 result)
370 (error "Import test failed! Found `%s'\nbut expected `%s'" result
371 expected-output)))
372 (kill-buffer (find-buffer-visiting temp-file))
373 (delete-file temp-file))))
375 ;; ======================================================================
376 ;; Test methods for cycle...
377 ;; ======================================================================
378 (defun icalendar-testsuite--test-cycle (input)
379 "Perform cycle test.
380 Argument INPUT icalendar event string."
381 (with-temp-buffer
382 (if (string-match "^BEGIN:VCALENDAR" input)
383 (insert input)
384 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
385 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
386 (insert input)
387 (unless (eq (char-before) ?\n)
388 (insert "\n"))
389 (insert "END:VEVENT\nEND:VCALENDAR\n"))
390 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
391 (icalendar-import-format-summary "%s")
392 (icalendar-import-format-location "\n Location: %s")
393 (icalendar-import-format-description "\n Desc: %s")
394 (icalendar-import-format-organizer "\n Organizer: %s")
395 (icalendar-import-format-status "\n Status: %s")
396 (icalendar-import-format-url "\n URL: %s")
397 (icalendar-import-format-class "\n Class: %s"))
398 (dolist (calendar-date-style '(iso european american))
399 (icalendar-testsuite--do-test-cycle)))))
401 (defun icalendar-testsuite--do-test-cycle ()
402 "Actually perform import/export cycle test."
403 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
404 (temp-ics (make-temp-file "icalendar-test-ics"))
405 (org-input (buffer-substring-no-properties (point-min) (point-max))))
406 (icalendar-import-buffer temp-diary t t)
407 (save-excursion
408 (find-file temp-diary)
409 (icalendar-export-region (point-min) (point-max) temp-ics))
410 (save-excursion
411 (find-file temp-ics)
412 (goto-char (point-min))
413 (when (re-search-forward "\nUID:.*\n" nil t)
414 (replace-match "\n"))
415 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
416 (unless (string-equal org-input cycled)
417 (error "Import test failed! Found `%s'\nbut expected `%s'" cycled
418 org-input))))
419 (kill-buffer (find-buffer-visiting temp-diary))
420 (save-excursion
421 (set-buffer (find-buffer-visiting temp-ics))
422 (set-buffer-modified-p nil)
423 (kill-buffer (current-buffer)))
424 (delete-file temp-diary)
425 (delete-file temp-ics)))
427 ;; ======================================================================
428 ;; Import tests
429 ;; ======================================================================
430 (defun icalendar-testsuite--run-import-tests ()
431 "Perform standard import tests."
432 (icalendar-testsuite--test-import
433 "SUMMARY:non-recurring
434 DTSTART;VALUE=DATE-TIME:20030919T090000
435 DTEND;VALUE=DATE-TIME:20030919T113000"
436 "&2003/9/19 09:00-11:30 non-recurring"
437 "&19/9/2003 09:00-11:30 non-recurring"
438 "&9/19/2003 09:00-11:30 non-recurring")
440 (icalendar-testsuite--test-import
441 "SUMMARY:non-recurring allday
442 DTSTART;VALUE=DATE-TIME:20030919"
443 "&2003/9/19 non-recurring allday"
444 "&19/9/2003 non-recurring allday"
445 "&9/19/2003 non-recurring allday")
447 (icalendar-testsuite--test-import
448 "SUMMARY:long
449 summary
450 DTSTART;VALUE=DATE:20030919"
451 "&2003/9/19 long summary"
452 "&19/9/2003 long summary"
453 "&9/19/2003 long summary")
455 (icalendar-testsuite--test-import
456 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
457 SUMMARY:Sommerferien
458 STATUS:TENTATIVE
459 CLASS:PRIVATE
460 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
461 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
462 DTSTART;VALUE=DATE:20040719
463 DTEND;VALUE=DATE:20040828
464 DTSTAMP:20031103T011641Z
466 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien"
467 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien"
468 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien")
470 (icalendar-testsuite--test-import
471 "UID
472 :04979712-3902-11d9-93dd-8f9f4afe08da
473 SUMMARY
474 :folded summary
475 STATUS
476 :TENTATIVE
477 CLASS
478 :PRIVATE
479 X-MOZILLA-ALARM-DEFAULT-LENGTH
481 DTSTART
482 :20041123T140000
483 DTEND
484 :20041123T143000
485 DTSTAMP
486 :20041118T013430Z
487 LAST-MODIFIED
488 :20041118T013640Z
490 "&2004/11/23 14:00-14:30 folded summary"
491 "&23/11/2004 14:00-14:30 folded summary"
492 "&11/23/2004 14:00-14:30 folded summary")
493 (icalendar-testsuite--test-import
494 "UID
495 :6161a312-3902-11d9-b512-f764153bb28b
496 SUMMARY
497 :another example
498 STATUS
499 :TENTATIVE
500 CLASS
501 :PRIVATE
502 X-MOZILLA-ALARM-DEFAULT-LENGTH
504 DTSTART
505 :20041123T144500
506 DTEND
507 :20041123T154500
508 DTSTAMP
509 :20041118T013641Z
511 "&2004/11/23 14:45-15:45 another example"
512 "&23/11/2004 14:45-15:45 another example"
513 "&11/23/2004 14:45-15:45 another example")
515 (icalendar-testsuite--test-import
516 "SUMMARY:rrule daily
517 DTSTART;VALUE=DATE-TIME:20030919T090000
518 DTEND;VALUE=DATE-TIME:20030919T113000
519 RRULE:FREQ=DAILY;
521 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily"
522 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily"
523 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily")
525 ;; RRULE examples
526 (icalendar-testsuite--test-import
527 "SUMMARY:rrule daily
528 DTSTART;VALUE=DATE-TIME:20030919T090000
529 DTEND;VALUE=DATE-TIME:20030919T113000
530 RRULE:FREQ=DAILY;INTERVAL=2
532 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily"
533 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily"
534 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily")
535 (icalendar-testsuite--test-import
536 "SUMMARY:rrule daily with exceptions
537 DTSTART;VALUE=DATE-TIME:20030919T090000
538 DTEND;VALUE=DATE-TIME:20030919T113000
539 RRULE:FREQ=DAILY;INTERVAL=2
540 EXDATE:20030921,20030925
542 "&%%(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"
543 "&%%(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"
544 "&%%(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")
546 (icalendar-testsuite--test-import
547 "SUMMARY:rrule weekly
548 DTSTART;VALUE=DATE-TIME:20030919T090000
549 DTEND;VALUE=DATE-TIME:20030919T113000
550 RRULE:FREQ=WEEKLY;
552 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly"
553 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly"
554 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly")
555 (icalendar-testsuite--test-import
556 "SUMMARY:rrule monthly no end
557 DTSTART;VALUE=DATE-TIME:20030919T090000
558 DTEND;VALUE=DATE-TIME:20030919T113000
559 RRULE:FREQ=MONTHLY;
561 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end"
562 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end"
563 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end")
564 (icalendar-testsuite--test-import
565 "SUMMARY:rrule monthly with end
566 DTSTART;VALUE=DATE-TIME:20030919T090000
567 DTEND;VALUE=DATE-TIME:20030919T113000
568 RRULE:FREQ=MONTHLY;UNTIL=20050819;
570 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end"
571 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end"
572 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end")
573 (icalendar-testsuite--test-import
574 "DTSTART;VALUE=DATE:20040815
575 DTEND;VALUE=DATE:20040816
576 SUMMARY:Maria Himmelfahrt
577 UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
578 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
580 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt"
581 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt"
582 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt")
583 (icalendar-testsuite--test-import
584 "SUMMARY:rrule yearly
585 DTSTART;VALUE=DATE-TIME:20030919T090000
586 DTEND;VALUE=DATE-TIME:20030919T113000
587 RRULE:FREQ=YEARLY;INTERVAL=2
589 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly" ;FIXME
590 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME
591 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME
592 (icalendar-testsuite--test-import
593 "SUMMARY:rrule count daily short
594 DTSTART;VALUE=DATE-TIME:20030919T090000
595 DTEND;VALUE=DATE-TIME:20030919T113000
596 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
598 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short"
599 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short"
600 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short")
601 (icalendar-testsuite--test-import
602 "SUMMARY:rrule count daily long
603 DTSTART;VALUE=DATE-TIME:20030919T090000
604 DTEND;VALUE=DATE-TIME:20030919T113000
605 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
607 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long"
608 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long"
609 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long")
610 (icalendar-testsuite--test-import
611 "SUMMARY:rrule count bi-weekly 3 times
612 DTSTART;VALUE=DATE-TIME:20030919T090000
613 DTEND;VALUE=DATE-TIME:20030919T113000
614 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
616 "&%%(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"
617 "&%%(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"
618 "&%%(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")
619 (icalendar-testsuite--test-import
620 "SUMMARY:rrule count monthly
621 DTSTART;VALUE=DATE-TIME:20030919T090000
622 DTEND;VALUE=DATE-TIME:20030919T113000
623 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
625 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly"
626 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly"
627 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly")
628 (icalendar-testsuite--test-import
629 "SUMMARY:rrule count every second month
630 DTSTART;VALUE=DATE-TIME:20030919T090000
631 DTEND;VALUE=DATE-TIME:20030919T113000
632 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
634 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month" ;FIXME
635 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME
636 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME
637 (icalendar-testsuite--test-import
638 "SUMMARY:rrule count yearly
639 DTSTART;VALUE=DATE-TIME:20030919T090000
640 DTEND;VALUE=DATE-TIME:20030919T113000
641 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
643 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly"
644 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly"
645 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly")
646 (icalendar-testsuite--test-import
647 "SUMMARY:rrule count every second year
648 DTSTART;VALUE=DATE-TIME:20030919T090000
649 DTEND;VALUE=DATE-TIME:20030919T113000
650 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
652 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year" ;FIXME!!!
653 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!!
654 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!!
656 ;; duration
657 (icalendar-testsuite--test-import
658 "DTSTART;VALUE=DATE:20050217
659 SUMMARY:duration
660 DURATION:P7D
662 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration"
663 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration"
664 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration")
666 (icalendar-testsuite--test-import
667 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
668 DTSTAMP:20041127T183315Z
669 LAST-MODIFIED:20041127T183329
670 SUMMARY:Urlaub
671 DTSTART;VALUE=DATE:20011221
672 DTEND;VALUE=DATE:20011221
673 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
674 CLASS:PUBLIC
675 SEQUENCE:1
676 CREATED:20041127T183329
678 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub"
679 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub"
680 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub")
683 ;; ======================================================================
684 ;; Export tests
685 ;; ======================================================================
686 (defun icalendar-testsuite--run-export-tests ()
687 "Perform standard export tests."
689 (let ((icalendar-export-hidden-diary-entries nil))
690 (icalendar-testsuite--test-export
691 "&2000 Oct 3 ordinary no time "
692 "&3 Okt 2000 ordinary no time "
693 "&Oct 3 2000 ordinary no time "
694 nil))
696 ;; "ordinary" events
697 (icalendar-testsuite--test-export
698 "2000 Oct 3 ordinary no time "
699 "3 Okt 2000 ordinary no time "
700 "Oct 3 2000 ordinary no time "
701 "DTSTART;VALUE=DATE:20001003
702 DTEND;VALUE=DATE:20001004
703 SUMMARY:ordinary no time
705 (icalendar-testsuite--test-export
706 "2000 Oct 3 16:30 ordinary with time"
707 "3 Okt 2000 16:30 ordinary with time"
708 "Oct 3 2000 16:30 ordinary with time"
709 "DTSTART;VALUE=DATE-TIME:20001003T163000
710 DTEND;VALUE=DATE-TIME:20001003T173000
711 SUMMARY:ordinary with time
713 (icalendar-testsuite--test-export
714 "2000 10 3 16:30 ordinary with time 2"
715 "3 10 2000 16:30 ordinary with time 2"
716 "10 3 2000 16:30 ordinary with time 2"
717 "DTSTART;VALUE=DATE-TIME:20001003T163000
718 DTEND;VALUE=DATE-TIME:20001003T173000
719 SUMMARY:ordinary with time 2
722 (icalendar-testsuite--test-export
723 "2000/10/3 16:30 ordinary with time 3"
724 "3/10/2000 16:30 ordinary with time 3"
725 "10/3/2000 16:30 ordinary with time 3"
726 "DTSTART;VALUE=DATE-TIME:20001003T163000
727 DTEND;VALUE=DATE-TIME:20001003T173000
728 SUMMARY:ordinary with time 3
731 ;; multiline -- FIXME!!!
732 (icalendar-testsuite--test-export
733 "2000 October 3 16:30 multiline
734 17:30 multiline continued FIXME"
735 "3 Oktober 2000 16:30 multiline
736 17:30 multiline continued FIXME"
737 "October 3 2000 16:30 multiline
738 17:30 multiline continued FIXME"
739 "DTSTART;VALUE=DATE-TIME:20001003T163000
740 DTEND;VALUE=DATE-TIME:20001003T173000
741 SUMMARY:multiline
742 DESCRIPTION:
743 17:30 multiline continued FIXME
746 ;; weekly by day
747 (icalendar-testsuite--test-export
748 "Monday 1:30pm weekly by day with start time"
749 "Montag 13:30 weekly by day with start time"
750 "Monday 1:30pm weekly by day with start time"
751 "DTSTART;VALUE=DATE-TIME:20000103T133000
752 DTEND;VALUE=DATE-TIME:20000103T143000
753 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
754 SUMMARY:weekly by day with start time
757 (icalendar-testsuite--test-export
758 "Monday 13:30-15:00 weekly by day with start and end time"
759 "Montag 13:30-15:00 weekly by day with start and end time"
760 "Monday 01:30pm-03:00pm weekly by day with start and end time"
761 "DTSTART;VALUE=DATE-TIME:20000103T133000
762 DTEND;VALUE=DATE-TIME:20000103T150000
763 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
764 SUMMARY:weekly by day with start and end time
767 ;; yearly
768 (icalendar-testsuite--test-export
769 "may 1 yearly no time"
770 "1 Mai yearly no time"
771 "may 1 yearly no time"
772 "DTSTART;VALUE=DATE:19000501
773 DTEND;VALUE=DATE:19000502
774 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
775 SUMMARY:yearly no time
778 ;; anniversaries
779 (icalendar-testsuite--test-export
780 "%%(diary-anniversary 1989 10 3) anniversary no time"
781 "%%(diary-anniversary 3 10 1989) anniversary no time"
782 "%%(diary-anniversary 10 3 1989) anniversary no time"
783 "DTSTART;VALUE=DATE:19891003
784 DTEND;VALUE=DATE:19891004
785 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
786 SUMMARY:anniversary no time
788 (icalendar-testsuite--test-export
789 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
790 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
791 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
792 "DTSTART;VALUE=DATE-TIME:19891003T190000
793 DTEND;VALUE=DATE-TIME:19891004T200000
794 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
795 SUMMARY:anniversary with time
798 ;; block
799 (icalendar-testsuite--test-export
800 "%%(diary-block 2001 6 18 2001 7 6) block no time"
801 "%%(diary-block 18 6 2001 6 7 2001) block no time"
802 "%%(diary-block 6 18 2001 7 6 2001) block no time"
803 "DTSTART;VALUE=DATE:20010618
804 DTEND;VALUE=DATE:20010707
805 SUMMARY:block no time
807 (icalendar-testsuite--test-export
808 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
809 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
810 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
811 "DTSTART;VALUE=DATE-TIME:20010618T130000
812 DTEND;VALUE=DATE-TIME:20010618T170000
813 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
814 SUMMARY:block with time
816 (icalendar-testsuite--test-export
817 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
818 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
819 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
820 "DTSTART;VALUE=DATE-TIME:20010618T130000
821 DTEND;VALUE=DATE-TIME:20010618T140000
822 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
823 SUMMARY:block no end time
827 ;; ======================================================================
828 ;; Real world
829 ;; ======================================================================
830 (defun icalendar-testsuite--run-real-world-tests ()
831 "Perform real-world tests, as gathered from problem reports."
832 ;; 2003-05-29
833 (icalendar-testsuite--test-import
834 "BEGIN:VCALENDAR
835 METHOD:REQUEST
836 PRODID:Microsoft CDO for Microsoft Exchange
837 VERSION:2.0
838 BEGIN:VTIMEZONE
839 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
840 X-MICROSOFT-CDO-TZID:23
841 BEGIN:STANDARD
842 DTSTART:16010101T000000
843 TZOFFSETFROM:+0530
844 TZOFFSETTO:+0530
845 END:STANDARD
846 BEGIN:DAYLIGHT
847 DTSTART:16010101T000000
848 TZOFFSETFROM:+0530
849 TZOFFSETTO:+0530
850 END:DAYLIGHT
851 END:VTIMEZONE
852 BEGIN:VEVENT
853 DTSTAMP:20030509T043439Z
854 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
855 SUMMARY:On-Site Interview
856 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
857 010000000DB823520692542408ED02D7023F9DFF9
858 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
859 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
860 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
861 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
862 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
863 zz\":MAILTO:zzzzzz@zzzzzzz.com
864 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
865 LOCATION:Cccc
866 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
867 DESCRIPTION:10:30am - Blah
868 SEQUENCE:0
869 PRIORITY:5
870 CLASS:
871 CREATED:20030509T043439Z
872 LAST-MODIFIED:20030509T043459Z
873 STATUS:CONFIRMED
874 TRANSP:OPAQUE
875 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
876 X-MICROSOFT-CDO-INSTTYPE:0
877 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
878 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
879 X-MICROSOFT-CDO-IMPORTANCE:1
880 X-MICROSOFT-CDO-OWNERAPPTID:126441427
881 BEGIN:VALARM
882 ACTION:DISPLAY
883 DESCRIPTION:REMINDER
884 TRIGGER;RELATED=START:-PT00H15M00S
885 END:VALARM
886 END:VEVENT
887 END:VCALENDAR"
889 "&9/5/2003 10:30-15:30 On-Site Interview
890 Desc: 10:30am - Blah
891 Location: Cccc
892 Organizer: MAILTO:aaaaaaa@aaaaaaa.com"
893 "&5/9/2003 10:30-15:30 On-Site Interview
894 Desc: 10:30am - Blah
895 Location: Cccc
896 Organizer: MAILTO:aaaaaaa@aaaaaaa.com")
898 ;; 2003-06-18 a
899 (icalendar-testsuite--test-import
900 "DTSTAMP:20030618T195512Z
901 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
902 SUMMARY:Dress Rehearsal for XXXX-XXXX
903 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
904 0100000007C3A6D65EE726E40B7F3D69A23BD567E
905 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
906 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
907 ORGANIZER;CN=\"ABCD,TECHTRAINING
908 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
909 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
910 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
911 DESCRIPTION:753 Zeichen hier radiert
912 SEQUENCE:0
913 PRIORITY:5
914 CLASS:
915 CREATED:20030618T195518Z
916 LAST-MODIFIED:20030618T195527Z
917 STATUS:CONFIRMED
918 TRANSP:OPAQUE
919 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
920 X-MICROSOFT-CDO-INSTTYPE:0
921 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
922 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
923 X-MICROSOFT-CDO-IMPORTANCE:1
924 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
925 BEGIN:VALARM
926 ACTION:DISPLAY
927 DESCRIPTION:REMINDER
928 TRIGGER;RELATED=START:-PT00H15M00S
929 END:VALARM"
931 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
932 Desc: 753 Zeichen hier radiert
933 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
934 Organizer: MAILTO:xxx@xxxxx.com"
935 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
936 Desc: 753 Zeichen hier radiert
937 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
938 Organizer: MAILTO:xxx@xxxxx.com")
940 ;; 2003-06-18 b -- uses timezone
941 (icalendar-testsuite--test-import
942 "BEGIN:VCALENDAR
943 METHOD:REQUEST
944 PRODID:Microsoft CDO for Microsoft Exchange
945 VERSION:2.0
946 BEGIN:VTIMEZONE
947 TZID:Mountain Time (US & Canada)
948 X-MICROSOFT-CDO-TZID:12
949 BEGIN:STANDARD
950 DTSTART:16010101T020000
951 TZOFFSETFROM:-0600
952 TZOFFSETTO:-0700
953 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
954 END:STANDARD
955 BEGIN:DAYLIGHT
956 DTSTART:16010101T020000
957 TZOFFSETFROM:-0700
958 TZOFFSETTO:-0600
959 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
960 END:DAYLIGHT
961 END:VTIMEZONE
962 BEGIN:VEVENT
963 DTSTAMP:20030618T230323Z
964 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
965 SUMMARY:Updated: Dress Rehearsal for ABC01-15
966 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
967 0100000007C3A6D65EE726E40B7F3D69A23BD567E
968 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
969 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
970 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
971 .com
972 ORGANIZER;CN=\"ABCD,TECHTRAINING
973 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
974 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
975 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
976 DESCRIPTION:Viele Zeichen standen hier früher
977 SEQUENCE:0
978 PRIORITY:5
979 CLASS:
980 CREATED:20030618T230326Z
981 LAST-MODIFIED:20030618T230335Z
982 STATUS:CONFIRMED
983 TRANSP:OPAQUE
984 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
985 X-MICROSOFT-CDO-INSTTYPE:0
986 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
987 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
988 X-MICROSOFT-CDO-IMPORTANCE:1
989 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
990 BEGIN:VALARM
991 ACTION:DISPLAY
992 DESCRIPTION:REMINDER
993 TRIGGER;RELATED=START:-PT00H15M00S
994 END:VALARM
995 END:VEVENT
996 END:VCALENDAR"
998 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
999 Desc: Viele Zeichen standen hier früher
1000 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1001 Organizer: MAILTO:bbb@bbbbb.com
1002 Status: CONFIRMED"
1003 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1004 Desc: Viele Zeichen standen hier früher
1005 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1006 Organizer: MAILTO:bbb@bbbbb.com
1007 Status: CONFIRMED")
1009 ;; export 2004-10-28 block entries
1010 (icalendar-testsuite--test-export
1013 "-*- mode: text; fill-column: 256;-*-
1015 >>> block entries:
1017 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1019 "DTSTART;VALUE=DATE:20041108
1020 DTEND;VALUE=DATE:20041111
1021 SUMMARY:Nov 8-10 aa")
1023 (icalendar-testsuite--test-export
1026 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1027 "DTSTART;VALUE=DATE:20041213
1028 DTEND;VALUE=DATE:20041218
1029 SUMMARY:Dec 13-17 bb")
1031 (icalendar-testsuite--test-export
1034 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1035 "DTSTART;VALUE=DATE:20050203
1036 DTEND;VALUE=DATE:20050205
1037 SUMMARY:Feb 3-4 cc")
1039 (icalendar-testsuite--test-export
1042 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1043 "DTSTART;VALUE=DATE:20050424
1044 DTEND;VALUE=DATE:20050430
1045 SUMMARY:April 24-29 dd
1047 (icalendar-testsuite--test-export
1050 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1051 "DTSTART;VALUE=DATE:20050530
1052 DTEND;VALUE=DATE:20050602
1053 SUMMARY:may 30 - June 1: ee")
1055 (icalendar-testsuite--test-export
1058 "%%(diary-block 6 6 2005 6 8 2005) ff"
1059 "DTSTART;VALUE=DATE:20050606
1060 DTEND;VALUE=DATE:20050609
1061 SUMMARY:ff")
1063 ;; export 2004-10-28 anniversary entries
1064 (icalendar-testsuite--test-export
1068 >>> anniversaries:
1070 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1071 "DTSTART;VALUE=DATE:19910328
1072 DTEND;VALUE=DATE:19910329
1073 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1074 SUMMARY:aa birthday (%d years old)
1077 (icalendar-testsuite--test-export
1080 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1081 "DTSTART;VALUE=DATE:19570517
1082 DTEND;VALUE=DATE:19570518
1083 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1084 SUMMARY:bb birthday (%d years old)")
1086 (icalendar-testsuite--test-export
1089 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1090 "DTSTART;VALUE=DATE:19970608
1091 DTEND;VALUE=DATE:19970609
1092 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1093 SUMMARY:cc birthday (%d years old)")
1095 (icalendar-testsuite--test-export
1098 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1099 "DTSTART;VALUE=DATE:19830722
1100 DTEND;VALUE=DATE:19830723
1101 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1102 SUMMARY:dd (%d years ago...!)")
1104 (icalendar-testsuite--test-export
1107 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1108 "DTSTART;VALUE=DATE:19880801
1109 DTEND;VALUE=DATE:19880802
1110 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1111 SUMMARY:ee birthday (%d years old)")
1113 (icalendar-testsuite--test-export
1116 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1117 "DTSTART;VALUE=DATE:19570921
1118 DTEND;VALUE=DATE:19570922
1119 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1120 SUMMARY:ff birthday (%d years old)")
1123 ;; FIXME!
1125 ;; export 2004-10-28 monthly, weekly entries
1127 ;; (icalendar-testsuite--test-export
1128 ;; nil
1129 ;; "
1130 ;; >>> ------------ monthly:
1132 ;; */27/* 10:00 blah blah"
1133 ;; "xxx")
1135 (icalendar-testsuite--test-export
1138 ">>> ------------ my week:
1140 Monday 13:00 MAC"
1141 "DTSTART;VALUE=DATE-TIME:20000103T130000
1142 DTEND;VALUE=DATE-TIME:20000103T140000
1143 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1144 SUMMARY:MAC")
1146 (icalendar-testsuite--test-export
1149 "Monday 15:00 a1"
1150 "DTSTART;VALUE=DATE-TIME:20000103T150000
1151 DTEND;VALUE=DATE-TIME:20000103T160000
1152 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1153 SUMMARY:a1")
1156 (icalendar-testsuite--test-export
1159 "Monday 16:00-17:00 a2"
1160 "DTSTART;VALUE=DATE-TIME:20000103T160000
1161 DTEND;VALUE=DATE-TIME:20000103T170000
1162 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1163 SUMMARY:a2")
1165 (icalendar-testsuite--test-export
1168 "Tuesday 11:30-13:00 a3"
1169 "DTSTART;VALUE=DATE-TIME:20000104T113000
1170 DTEND;VALUE=DATE-TIME:20000104T130000
1171 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1172 SUMMARY:a3")
1174 (icalendar-testsuite--test-export
1177 "Tuesday 15:00 a4"
1178 "DTSTART;VALUE=DATE-TIME:20000104T150000
1179 DTEND;VALUE=DATE-TIME:20000104T160000
1180 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1181 SUMMARY:a4")
1183 (icalendar-testsuite--test-export
1186 "Wednesday 13:00 a5"
1187 "DTSTART;VALUE=DATE-TIME:20000105T130000
1188 DTEND;VALUE=DATE-TIME:20000105T140000
1189 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1190 SUMMARY:a5")
1192 (icalendar-testsuite--test-export
1195 "Wednesday 11:30-13:30 a6"
1196 "DTSTART;VALUE=DATE-TIME:20000105T113000
1197 DTEND;VALUE=DATE-TIME:20000105T133000
1198 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1199 SUMMARY:a6")
1201 (icalendar-testsuite--test-export
1204 "Wednesday 15:00 s1"
1205 "DTSTART;VALUE=DATE-TIME:20000105T150000
1206 DTEND;VALUE=DATE-TIME:20000105T160000
1207 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1208 SUMMARY:s1")
1211 ;; export 2004-10-28 regular entries
1212 (icalendar-testsuite--test-export
1216 >>> regular diary entries:
1218 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1219 "DTSTART;VALUE=DATE-TIME:20041012T140000
1220 DTEND;VALUE=DATE-TIME:20041012T150000
1221 SUMMARY:Tue: [2004-10-12] q1")
1223 ;; 2004-11-19
1224 (icalendar-testsuite--test-import
1225 "BEGIN:VCALENDAR
1226 VERSION
1227 :2.0
1228 PRODID
1229 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1230 BEGIN:VEVENT
1232 :04979712-3902-11d9-93dd-8f9f4afe08da
1233 SUMMARY
1234 :Jjjjj & Wwwww
1235 STATUS
1236 :TENTATIVE
1237 CLASS
1238 :PRIVATE
1239 X-MOZILLA-ALARM-DEFAULT-LENGTH
1241 DTSTART
1242 :20041123T140000
1243 DTEND
1244 :20041123T143000
1245 DTSTAMP
1246 :20041118T013430Z
1247 LAST-MODIFIED
1248 :20041118T013640Z
1249 END:VEVENT
1250 BEGIN:VEVENT
1252 :6161a312-3902-11d9-b512-f764153bb28b
1253 SUMMARY
1254 :BB Aaaaaaaa Bbbbb
1255 STATUS
1256 :TENTATIVE
1257 CLASS
1258 :PRIVATE
1259 X-MOZILLA-ALARM-DEFAULT-LENGTH
1261 DTSTART
1262 :20041123T144500
1263 DTEND
1264 :20041123T154500
1265 DTSTAMP
1266 :20041118T013641Z
1267 END:VEVENT
1268 BEGIN:VEVENT
1270 :943a4d7e-3902-11d9-9ce7-c9addeadf928
1271 SUMMARY
1272 :Hhhhhhhh
1273 STATUS
1274 :TENTATIVE
1275 CLASS
1276 :PRIVATE
1277 X-MOZILLA-ALARM-DEFAULT-LENGTH
1279 DTSTART
1280 :20041123T110000
1281 DTEND
1282 :20041123T120000
1283 DTSTAMP
1284 :20041118T013831Z
1285 END:VEVENT
1286 BEGIN:VEVENT
1288 :fe53615e-3902-11d9-9dd8-9d38a155bf41
1289 SUMMARY
1290 :MMM Aaaaaaaaa
1291 STATUS
1292 :TENTATIVE
1293 CLASS
1294 :PRIVATE
1295 X-MOZILLA-ALARM-DEFAULT-LENGTH
1297 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1299 RRULE
1300 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1301 DTSTART
1302 :20041112T140000
1303 DTEND
1304 :20041112T183000
1305 DTSTAMP
1306 :20041118T014117Z
1307 END:VEVENT
1308 BEGIN:VEVENT
1310 :87c928ee-3901-11d9-b21f-b45042155024
1311 SUMMARY
1312 :Rrrr/Cccccc ii Aaaaaaaa
1313 DESCRIPTION
1314 :Vvvvv Rrrr aaa Cccccc
1315 STATUS
1316 :TENTATIVE
1317 CLASS
1318 :PRIVATE
1319 X-MOZILLA-ALARM-DEFAULT-LENGTH
1321 DTSTART
1322 ;VALUE=DATE
1323 :20041119
1324 DTEND
1325 ;VALUE=DATE
1326 :20041120
1327 DTSTAMP
1328 :20041118T013107Z
1329 LAST-MODIFIED
1330 :20041118T014203Z
1331 END:VEVENT
1332 BEGIN:VEVENT
1334 :e8f331ae-3902-11d9-9948-dfdcb66a2872
1335 SUMMARY
1336 :Wwww aa hhhh
1337 STATUS
1338 :TENTATIVE
1339 CLASS
1340 :PRIVATE
1341 X-MOZILLA-ALARM-DEFAULT-LENGTH
1343 RRULE
1344 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1345 DTSTART
1346 ;VALUE=DATE
1347 :20041101
1348 DTEND
1349 ;VALUE=DATE
1350 :20041102
1351 DTSTAMP
1352 :20041118T014045Z
1353 LAST-MODIFIED
1354 :20041118T023846Z
1355 END:VEVENT
1356 END:VCALENDAR
1359 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1360 Status: TENTATIVE
1361 Class: PRIVATE
1362 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1363 Status: TENTATIVE
1364 Class: PRIVATE
1365 &23/11/2004 11:00-12:00 Hhhhhhhh
1366 Status: TENTATIVE
1367 Class: PRIVATE
1368 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1369 Status: TENTATIVE
1370 Class: PRIVATE
1371 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1372 Desc: Vvvvv Rrrr aaa Cccccc
1373 Status: TENTATIVE
1374 Class: PRIVATE
1375 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1376 Status: TENTATIVE
1377 Class: PRIVATE "
1378 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1379 Status: TENTATIVE
1380 Class: PRIVATE
1381 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1382 Status: TENTATIVE
1383 Class: PRIVATE
1384 &11/23/2004 11:00-12:00 Hhhhhhhh
1385 Status: TENTATIVE
1386 Class: PRIVATE
1387 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1388 Status: TENTATIVE
1389 Class: PRIVATE
1390 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1391 Desc: Vvvvv Rrrr aaa Cccccc
1392 Status: TENTATIVE
1393 Class: PRIVATE
1394 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1395 Status: TENTATIVE
1396 Class: PRIVATE ")
1398 ;; 2004-09-09 pg
1399 (icalendar-testsuite--test-export
1400 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1403 "DTSTART;VALUE=DATE:20040101
1404 DTEND;VALUE=DATE:20040105
1405 SUMMARY:Urlaub")
1407 ;; 2004-10-25 pg
1408 (icalendar-testsuite--test-export
1410 "5 11 2004 Bla Fasel"
1412 "DTSTART;VALUE=DATE:20041105
1413 DTEND;VALUE=DATE:20041106
1414 SUMMARY:Bla Fasel")
1416 ;; 2004-10-30 pg
1417 (icalendar-testsuite--test-export
1419 "2 Nov 2004 15:00-16:30 Zahnarzt"
1421 "DTSTART;VALUE=DATE-TIME:20041102T150000
1422 DTEND;VALUE=DATE-TIME:20041102T163000
1423 SUMMARY:Zahnarzt")
1425 ;; 2005-02-07 lt
1426 (icalendar-testsuite--test-import
1427 "UID
1428 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1429 SUMMARY
1430 :Waitangi Day
1431 DESCRIPTION
1432 :abcdef
1433 CATEGORIES
1434 :Public Holiday
1435 STATUS
1436 :CONFIRMED
1437 CLASS
1438 :PRIVATE
1439 DTSTART
1440 ;VALUE=DATE
1441 :20050206
1442 DTEND
1443 ;VALUE=DATE
1444 :20050207
1445 DTSTAMP
1446 :20050128T011209Z"
1448 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1449 Desc: abcdef"
1450 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1451 Desc: abcdef")
1453 ;; 2005-03-01 lt
1454 (icalendar-testsuite--test-import
1455 "DTSTART;VALUE=DATE:20050217
1456 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1457 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1458 DTSTAMP:20050118T210335Z
1459 DURATION:P7D"
1461 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa"
1462 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa")
1464 ;; 2005-03-23 lt
1465 (icalendar-testsuite--test-export
1467 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1469 "DTSTART;VALUE=DATE-TIME:20050208T160000
1470 DTEND;VALUE=DATE-TIME:20050208T164500
1471 RRULE:FREQ=DAILY;INTERVAL=7
1472 SUMMARY:[WORK] Pppp
1475 ;; 2005-05-27 eu
1476 (icalendar-testsuite--test-export
1479 ;; FIXME: colon not allowed!
1480 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1481 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1482 "DTSTART;VALUE=DATE:19001101
1483 DTEND;VALUE=DATE:19001102
1484 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1485 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1489 (defun icalendar-testsuite--run-cycle-tests ()
1490 "Perform cycling tests."
1491 (icalendar-testsuite--test-cycle
1492 "DTSTART;VALUE=DATE-TIME:20030919T090000
1493 DTEND;VALUE=DATE-TIME:20030919T113000
1494 SUMMARY:Cycletest
1497 (icalendar-testsuite--test-cycle
1498 "DTSTART;VALUE=DATE-TIME:20030919T090000
1499 DTEND;VALUE=DATE-TIME:20030919T113000
1500 SUMMARY:Cycletest
1501 DESCRIPTION:beschreibung!
1502 LOCATION:nowhere
1503 ORGANIZER:ulf
1506 ;; FIXME: does not work
1507 ;; (icalendar-testsuite--test-cycle
1508 ;; "DTSTART;VALUE=DATE:19190909
1509 ;;DTEND;VALUE=DATE:19190910
1510 ;;RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1511 ;;SUMMARY:and diary-anniversary
1512 ;;")
1516 (provide 'icalendar-testsuite)
1518 ;; arch-tag: 33a98396-90e9-49c8-b0e9-b606386d6e8c
1519 ;;; icalendar-testsuite.el ends here