(python-shift-left, python-shift-right):
[emacs.git] / test / icalendar-testsuite.el
blobe926eabce24c62ef74ca12cf5f8838191f41d9d9
1 ;; icalendar-testsuite.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008, 2009 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-diarytime-to-isotime)
55 (icalendar-testsuite--test-calendar-style)
56 (icalendar-testsuite--test-create-uid))
58 (defun icalendar-testsuite--test-format-ical-event ()
59 "Test `icalendar--format-ical-event'."
60 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
61 (icalendar-import-format-summary "SUM %s")
62 (icalendar-import-format-location " LOC %s")
63 (icalendar-import-format-description " DES %s")
64 (icalendar-import-format-organizer " ORG %s")
65 (icalendar-import-format-status " STA %s")
66 (icalendar-import-format-url " URL %s")
67 (icalendar-import-format-class " CLA %s")
68 (event (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
69 DTSTAMP:20030509T043439Z
70 DTSTART:20030509T103000
71 SUMMARY:sum
72 ORGANIZER:org
73 LOCATION:loc
74 DTEND:20030509T153000
75 DESCRIPTION:des
76 END:VEVENT
77 ")))
78 (assert (string= (icalendar--format-ical-event event)
79 "SUM sum DES des LOC loc ORG org") t)
80 (setq icalendar-import-format (lambda (&rest ignore)
81 "helloworld"))
82 (assert (string= (icalendar--format-ical-event event)
83 "helloworld") t)
84 (setq icalendar-import-format
85 (lambda (e)
86 (format "-%s-%s-%s-%s-%s-%s-%s-"
87 (icalendar--get-event-property event 'SUMMARY)
88 (icalendar--get-event-property event 'DESCRIPTION)
89 (icalendar--get-event-property event 'LOCATION)
90 (icalendar--get-event-property event 'ORGANIZER)
91 (icalendar--get-event-property event 'STATUS)
92 (icalendar--get-event-property event 'URL)
93 (icalendar--get-event-property event 'CLASS))))
94 (assert (string= (icalendar--format-ical-event event)
95 "-sum-des-loc-org-nil-nil-nil-") t)))
97 (defun icalendar-testsuite--test-parse-summary-and-rest ()
98 "Test `icalendar--parse-summary-and-rest'."
99 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
100 (icalendar-import-format-summary "SUM %s")
101 (icalendar-import-format-location " LOC %s")
102 (icalendar-import-format-description " DES %s")
103 (icalendar-import-format-organizer " ORG %s")
104 (icalendar-import-format-status " STA %s")
105 (icalendar-import-format-url " URL %s")
106 (icalendar-import-format-class " CLA %s")
107 (result))
108 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org"))
109 (assert (string= (cdr (assoc 'org result)) "org"))
111 (setq result (icalendar--parse-summary-and-rest
112 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
113 (assert (string= (cdr (assoc 'des result)) "des"))
114 (assert (string= (cdr (assoc 'loc result)) "loc"))
115 (assert (string= (cdr (assoc 'org result)) "org"))
116 (assert (string= (cdr (assoc 'sta result)) "sta"))
117 (assert (string= (cdr (assoc 'cla result)) "cla"))
119 (setq icalendar-import-format (lambda () "Hello world"))
120 (setq result (icalendar--parse-summary-and-rest
121 "blah blah "))
122 (assert (not result))
125 (defun icalendar-testsuite--get-ical-event (ical-string)
126 "Helper function for testing `icalendar-testsuite--test-format-ical-event'.
127 Return icalendar event for ICAL-STRING."
128 (save-excursion
129 (with-temp-buffer
130 (insert ical-string)
131 (goto-char (point-min))
132 (car (icalendar--read-element nil nil)))))
134 (defun icalendar-testsuite--test-import-format-sample ()
135 "Test method for `icalendar-import-format-sample'."
136 (assert (string= (icalendar-import-format-sample
137 (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
138 DTSTAMP:20030509T043439Z
139 DTSTART:20030509T103000
140 SUMMARY:a
141 ORGANIZER:d
142 LOCATION:c
143 DTEND:20030509T153000
144 DESCRIPTION:b
145 END:VEVENT
147 (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
148 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'"))))
150 (defun icalendar-testsuite--test-first-weekday-of-year ()
151 "Test method for `icalendar-first-weekday-of-year'."
152 (assert (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
153 (assert (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
154 (assert (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
155 (assert (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
156 (assert (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
157 (assert (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
158 (assert (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
159 (assert (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
160 (assert (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
162 (defun icalendar-testsuite--test-datestring-to-isodate ()
163 "Test method for `icalendar--datestring-to-isodate'."
164 (let ((calendar-date-style 'iso))
165 ;; numeric iso
166 (assert (string= (icalendar--datestring-to-isodate "2008 05 11")
167 "20080511"))
168 (assert (string= (icalendar--datestring-to-isodate "2008 05 31")
169 "20080531"))
170 (assert (string= (icalendar--datestring-to-isodate "2008 05 31" 2)
171 "20080602"))
173 ;; numeric european
174 (setq calendar-date-style 'european)
175 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
176 "20080511"))
177 (assert (string= (icalendar--datestring-to-isodate "31 05 2008")
178 "20080531"))
179 (assert (string= (icalendar--datestring-to-isodate "31 05 2008" 2)
180 "20080602"))
182 ;; numeric american
183 (setq calendar-date-style 'american)
184 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
185 "20081105"))
186 (assert (string= (icalendar--datestring-to-isodate "12 30 2008")
187 "20081230"))
188 (assert (string= (icalendar--datestring-to-isodate "12 30 2008" 2)
189 "20090101"))
191 ;; non-numeric
192 (setq calendar-date-style nil) ;not necessary for conversion
193 (assert (string= (icalendar--datestring-to-isodate "Nov 05 2008")
194 "20081105"))
195 (assert (string= (icalendar--datestring-to-isodate "05 Nov 2008")
196 "20081105"))
197 (assert (string= (icalendar--datestring-to-isodate "2008 Nov 05")
198 "20081105"))))
200 (defun icalendar-testsuite--test-datetime-to-diary-date ()
201 "Test method for `icalendar--datetime-to-diary-date'."
202 (let* ((datetime '(59 59 23 31 12 2008))
203 (calendar-date-style 'iso))
204 (assert (string= (icalendar--datetime-to-diary-date datetime)
205 "2008 12 31"))
206 (setq calendar-date-style 'european)
207 (assert (string= (icalendar--datetime-to-diary-date datetime)
208 "31 12 2008"))
209 (setq calendar-date-style 'american)
210 (assert (string= (icalendar--datetime-to-diary-date datetime)
211 "12 31 2008"))))
213 (defun icalendar-testsuite--test-diarytime-to-isotime ()
214 "Test method for `icalendar--diarytime-to-isotime'."
215 (assert (string= (icalendar--diarytime-to-isotime "0100" "")
216 "T010000"))
217 (assert (string= (icalendar--diarytime-to-isotime "0100" "am")
218 "T010000"))
219 (assert (string= (icalendar--diarytime-to-isotime "0100" "pm")
220 "T130000"))
221 (assert (string= (icalendar--diarytime-to-isotime "1200" "")
222 "T120000"))
223 (assert (string= (icalendar--diarytime-to-isotime "17:17" "")
224 "T171700"))
225 (assert (string= (icalendar--diarytime-to-isotime "1200" "am")
226 "T000000"))
227 (assert (string= (icalendar--diarytime-to-isotime "1201" "am")
228 "T000100"))
229 (assert (string= (icalendar--diarytime-to-isotime "1259" "am")
230 "T005900"))
231 (assert (string= (icalendar--diarytime-to-isotime "1200" "pm")
232 "T120000"))
233 (assert (string= (icalendar--diarytime-to-isotime "1201" "pm")
234 "T120100"))
235 (assert (string= (icalendar--diarytime-to-isotime "1259" "pm")
236 "T125900")))
238 (defun icalendar-testsuite--test-calendar-style ()
239 "Test method for `icalendar--date-style'."
240 (dolist (calendar-date-style '(iso american european))
241 (assert (eq (icalendar--date-style) calendar-date-style)))
242 (let ((cds calendar-date-style)
243 (european-calendar-style t))
244 (makunbound 'calendar-date-style)
245 (assert (eq (icalendar--date-style) 'european))
246 (with-no-warnings (setq european-calendar-style nil)) ;still get warning!?! FIXME
247 (assert (eq (icalendar--date-style) 'american))
248 (setq calendar-date-style cds)))
250 (defun icalendar-testsuite--test-create-uid ()
251 "Test method for `icalendar--create-uid'."
252 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
253 t-ct
254 (icalendar--uid-count 77)
255 (entry-full "30.06.1964 07:01 blahblah")
256 (hash (format "%d" (abs (sxhash entry-full))))
257 (contents "DTSTART:19640630T070100\nblahblah")
258 (username (or user-login-name "UNKNOWN_USER"))
260 ;; FIXME! If a test fails 'current-time is screwed. FIXME!
261 (fset 't-ct (symbol-function 'current-time))
262 (fset 'current-time (lambda () '(1 2 3)))
263 (assert (= 77 icalendar--uid-count))
264 (assert (string= (concat "xxx-123-77-" hash "-" username "-19640630")
265 (icalendar--create-uid entry-full contents)))
266 (assert (= 78 icalendar--uid-count))
267 (fset 'current-time (symbol-function 't-ct))
269 (setq contents "blahblah")
270 (setq icalendar-uid-format "yyy%syyy")
271 (assert (string= (concat "yyyDTSTARTyyy")
272 (icalendar--create-uid entry-full contents)))
276 ;; ======================================================================
277 ;; Test methods for exporting from diary to icalendar
278 ;; ======================================================================
280 (defun icalendar-testsuite--test-export (input-iso input-european input-american
281 expected-output)
282 "Perform an export test.
283 Argument INPUT-ISO iso style diary string.
284 Argument INPUT-EUROPEAN european style diary string.
285 Argument INPUT-AMERICAN american style diary string.
286 Argument EXPECTED-OUTPUT expected icalendar result string.
288 European style input data must use german month names. American
289 and ISO style input data must use english month names."
290 (message "--- icalendar-testsuite--test-export ---")
291 (let ((calendar-date-style 'iso)
292 (icalendar-recurring-start-year 2000))
293 (set-time-zone-rule "CET") ;;FIXME: reset timezone!
294 (when input-iso
295 (let ((calendar-month-name-array
296 ["January" "February" "March" "April" "May" "June" "July" "August"
297 "September" "October" "November" "December"])
298 (calendar-day-name-array
299 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
300 "Saturday"]))
301 (setq calendar-date-style 'iso)
302 (icalendar-testsuite--do-test-export input-iso expected-output)))
303 (when input-european
304 (let ((calendar-month-name-array
305 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
306 "September" "Oktober" "November" "Dezember"])
307 (calendar-day-name-array
308 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
309 "Samstag"]))
310 (setq calendar-date-style 'european)
311 (icalendar-testsuite--do-test-export input-european expected-output)))
312 (when input-american
313 (let ((calendar-month-name-array
314 ["January" "February" "March" "April" "May" "June" "July" "August"
315 "September" "October" "November" "December"])
316 (calendar-day-name-array
317 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
318 "Saturday"]))
319 (setq calendar-date-style 'american)
320 (icalendar-testsuite--do-test-export input-american expected-output)))))
322 (defun icalendar-testsuite--do-test-export (input expected-output)
323 "Actually perform export test.
324 Argument INPUT input diary string.
325 Argument EXPECTED-OUTPUT expected icalendar result string."
326 (let ((temp-file (make-temp-file "icalendar-testsuite-ics")))
327 (with-temp-buffer
328 (insert input)
329 (icalendar-export-region (point-min) (point-max) temp-file))
330 (save-excursion
331 (find-file temp-file)
332 (goto-char (point-min))
333 (unless
334 (cond (expected-output
335 (and (re-search-forward "^\\s-*BEGIN:VCALENDAR
336 PRODID:-//Emacs//NONSGML icalendar.el//EN
337 VERSION:2.0
338 BEGIN:VEVENT
339 UID:emacs[0-9]+
340 \\(\\(.\\|\n\\)+\\)
341 END:VEVENT
342 END:VCALENDAR
343 \\s-*$"
344 nil t)
345 (string-match
346 (concat "^\\s-*"
347 (regexp-quote (buffer-substring-no-properties
348 (match-beginning 1) (match-end 1)))
349 "\\s-*$")
350 expected-output)))
352 (re-search-forward "^\\s-*BEGIN:VCALENDAR
353 PRODID:-//Emacs//NONSGML icalendar.el//EN
354 VERSION:2.0
355 END:VCALENDAR
356 \\s-*$"
357 nil t)))
358 (error
359 "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s"
360 input
361 (or (and (match-beginning 1)
362 (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
363 "<nil>")
364 (or expected-output "<nil>"))))
365 (kill-buffer (find-buffer-visiting temp-file))
366 (delete-file temp-file)))
368 ;; ======================================================================
369 ;; Test methods for importing from icalendar to diary
370 ;; ======================================================================
372 (defun icalendar-testsuite--test-import (input expected-iso expected-european
373 expected-american)
374 "Perform import test.
375 Argument INPUT icalendar event string.
376 Argument EXPECTED-ISO expected iso style diary string.
377 Argument EXPECTED-EUROPEAN expected european style diary string.
378 Argument EXPECTED-AMERICAN expected american style diary string."
379 (message "--- icalendar-testsuite--test-import ---")
380 (let ((timezone (cadr (current-time-zone))))
381 (set-time-zone-rule "CET")
382 (with-temp-buffer
383 (if (string-match "^BEGIN:VCALENDAR" input)
384 (insert input)
385 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
386 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
387 (insert input)
388 (unless (eq (char-before) ?\n)
389 (insert "\n"))
390 (insert "END:VEVENT\nEND:VCALENDAR\n"))
391 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
392 (icalendar-import-format-summary "%s")
393 (icalendar-import-format-location "\n Location: %s")
394 (icalendar-import-format-description "\n Desc: %s")
395 (icalendar-import-format-organizer "\n Organizer: %s")
396 (icalendar-import-format-status "\n Status: %s")
397 (icalendar-import-format-url "\n URL: %s")
398 (icalendar-import-format-class "\n Class: %s")
399 calendar-date-style)
400 (when expected-iso
401 (setq calendar-date-style 'iso)
402 (icalendar-testsuite--do-test-import input expected-iso))
403 (when expected-european
404 (setq calendar-date-style 'european)
405 (icalendar-testsuite--do-test-import input expected-european))
406 (when expected-american
407 (setq calendar-date-style 'american)
408 (icalendar-testsuite--do-test-import input expected-american))))
409 (set-time-zone-rule timezone)))
411 (defun icalendar-testsuite--do-test-import (input expected-output)
412 "Actually perform import test.
413 Argument INPUT input icalendar string.
414 Argument EXPECTED-OUTPUT expected diary string."
415 (let ((temp-file (make-temp-file "icalendar-test-diary")))
416 (icalendar-import-buffer temp-file t t)
417 (save-excursion
418 (find-file temp-file)
419 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
420 (unless (string-match (concat "^\\s-*" expected-output "\\s-*$")
421 result)
422 (error "Import test failed! Found `%s'\nbut expected `%s'" result
423 expected-output)))
424 (kill-buffer (find-buffer-visiting temp-file))
425 (delete-file temp-file))))
427 ;; ======================================================================
428 ;; Test methods for cycle...
429 ;; ======================================================================
430 (defun icalendar-testsuite--test-cycle (input)
431 "Perform cycle test.
432 Argument INPUT icalendar event string."
433 (with-temp-buffer
434 (if (string-match "^BEGIN:VCALENDAR" input)
435 (insert input)
436 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
437 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
438 (insert input)
439 (unless (eq (char-before) ?\n)
440 (insert "\n"))
441 (insert "END:VEVENT\nEND:VCALENDAR\n"))
442 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
443 (icalendar-import-format-summary "%s")
444 (icalendar-import-format-location "\n Location: %s")
445 (icalendar-import-format-description "\n Desc: %s")
446 (icalendar-import-format-organizer "\n Organizer: %s")
447 (icalendar-import-format-status "\n Status: %s")
448 (icalendar-import-format-url "\n URL: %s")
449 (icalendar-import-format-class "\n Class: %s"))
450 (dolist (calendar-date-style '(iso european american))
451 (icalendar-testsuite--do-test-cycle)))))
453 (defun icalendar-testsuite--do-test-cycle ()
454 "Actually perform import/export cycle test."
455 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
456 (temp-ics (make-temp-file "icalendar-test-ics"))
457 (org-input (buffer-substring-no-properties (point-min) (point-max))))
458 (icalendar-import-buffer temp-diary t t)
459 (save-excursion
460 (find-file temp-diary)
461 (icalendar-export-region (point-min) (point-max) temp-ics))
462 (save-excursion
463 (find-file temp-ics)
464 (goto-char (point-min))
465 (when (re-search-forward "\nUID:.*\n" nil t)
466 (replace-match "\n"))
467 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
468 (unless (string-equal org-input cycled)
469 (error "Import test failed! Found `%s'\nbut expected `%s'" cycled
470 org-input))))
471 (kill-buffer (find-buffer-visiting temp-diary))
472 (save-excursion
473 (set-buffer (find-buffer-visiting temp-ics))
474 (set-buffer-modified-p nil)
475 (kill-buffer (current-buffer)))
476 (delete-file temp-diary)
477 (delete-file temp-ics)))
479 ;; ======================================================================
480 ;; Import tests
481 ;; ======================================================================
482 (defun icalendar-testsuite--run-import-tests ()
483 "Perform standard import tests."
484 (icalendar-testsuite--test-import
485 "SUMMARY:non-recurring
486 DTSTART;VALUE=DATE-TIME:20030919T090000
487 DTEND;VALUE=DATE-TIME:20030919T113000"
488 "&2003/9/19 09:00-11:30 non-recurring"
489 "&19/9/2003 09:00-11:30 non-recurring"
490 "&9/19/2003 09:00-11:30 non-recurring")
492 (icalendar-testsuite--test-import
493 "SUMMARY:non-recurring allday
494 DTSTART;VALUE=DATE-TIME:20030919"
495 "&2003/9/19 non-recurring allday"
496 "&19/9/2003 non-recurring allday"
497 "&9/19/2003 non-recurring allday")
499 (icalendar-testsuite--test-import
500 "SUMMARY:long
501 summary
502 DTSTART;VALUE=DATE:20030919"
503 "&2003/9/19 long summary"
504 "&19/9/2003 long summary"
505 "&9/19/2003 long summary")
507 (icalendar-testsuite--test-import
508 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
509 SUMMARY:Sommerferien
510 STATUS:TENTATIVE
511 CLASS:PRIVATE
512 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
513 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
514 DTSTART;VALUE=DATE:20040719
515 DTEND;VALUE=DATE:20040828
516 DTSTAMP:20031103T011641Z
518 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien"
519 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien"
520 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien")
522 (icalendar-testsuite--test-import
523 "UID
524 :04979712-3902-11d9-93dd-8f9f4afe08da
525 SUMMARY
526 :folded summary
527 STATUS
528 :TENTATIVE
529 CLASS
530 :PRIVATE
531 X-MOZILLA-ALARM-DEFAULT-LENGTH
533 DTSTART
534 :20041123T140000
535 DTEND
536 :20041123T143000
537 DTSTAMP
538 :20041118T013430Z
539 LAST-MODIFIED
540 :20041118T013640Z
542 "&2004/11/23 14:00-14:30 folded summary"
543 "&23/11/2004 14:00-14:30 folded summary"
544 "&11/23/2004 14:00-14:30 folded summary")
545 (icalendar-testsuite--test-import
546 "UID
547 :6161a312-3902-11d9-b512-f764153bb28b
548 SUMMARY
549 :another example
550 STATUS
551 :TENTATIVE
552 CLASS
553 :PRIVATE
554 X-MOZILLA-ALARM-DEFAULT-LENGTH
556 DTSTART
557 :20041123T144500
558 DTEND
559 :20041123T154500
560 DTSTAMP
561 :20041118T013641Z
563 "&2004/11/23 14:45-15:45 another example"
564 "&23/11/2004 14:45-15:45 another example"
565 "&11/23/2004 14:45-15:45 another example")
567 (icalendar-testsuite--test-import
568 "SUMMARY:rrule daily
569 DTSTART;VALUE=DATE-TIME:20030919T090000
570 DTEND;VALUE=DATE-TIME:20030919T113000
571 RRULE:FREQ=DAILY;
573 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily"
574 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily"
575 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily")
577 ;; RRULE examples
578 (icalendar-testsuite--test-import
579 "SUMMARY:rrule daily
580 DTSTART;VALUE=DATE-TIME:20030919T090000
581 DTEND;VALUE=DATE-TIME:20030919T113000
582 RRULE:FREQ=DAILY;INTERVAL=2
584 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily"
585 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily"
586 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily")
587 (icalendar-testsuite--test-import
588 "SUMMARY:rrule daily with exceptions
589 DTSTART;VALUE=DATE-TIME:20030919T090000
590 DTEND;VALUE=DATE-TIME:20030919T113000
591 RRULE:FREQ=DAILY;INTERVAL=2
592 EXDATE:20030921,20030925
594 "&%%(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"
595 "&%%(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"
596 "&%%(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")
598 (icalendar-testsuite--test-import
599 "SUMMARY:rrule weekly
600 DTSTART;VALUE=DATE-TIME:20030919T090000
601 DTEND;VALUE=DATE-TIME:20030919T113000
602 RRULE:FREQ=WEEKLY;
604 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly"
605 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly"
606 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly")
607 (icalendar-testsuite--test-import
608 "SUMMARY:rrule monthly no end
609 DTSTART;VALUE=DATE-TIME:20030919T090000
610 DTEND;VALUE=DATE-TIME:20030919T113000
611 RRULE:FREQ=MONTHLY;
613 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end"
614 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end"
615 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end")
616 (icalendar-testsuite--test-import
617 "SUMMARY:rrule monthly with end
618 DTSTART;VALUE=DATE-TIME:20030919T090000
619 DTEND;VALUE=DATE-TIME:20030919T113000
620 RRULE:FREQ=MONTHLY;UNTIL=20050819;
622 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end"
623 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end"
624 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end")
625 (icalendar-testsuite--test-import
626 "DTSTART;VALUE=DATE:20040815
627 DTEND;VALUE=DATE:20040816
628 SUMMARY:Maria Himmelfahrt
629 UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
630 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
632 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt"
633 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt"
634 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt")
635 (icalendar-testsuite--test-import
636 "SUMMARY:rrule yearly
637 DTSTART;VALUE=DATE-TIME:20030919T090000
638 DTEND;VALUE=DATE-TIME:20030919T113000
639 RRULE:FREQ=YEARLY;INTERVAL=2
641 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly" ;FIXME
642 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME
643 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME
644 (icalendar-testsuite--test-import
645 "SUMMARY:rrule count daily short
646 DTSTART;VALUE=DATE-TIME:20030919T090000
647 DTEND;VALUE=DATE-TIME:20030919T113000
648 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
650 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short"
651 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short"
652 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short")
653 (icalendar-testsuite--test-import
654 "SUMMARY:rrule count daily long
655 DTSTART;VALUE=DATE-TIME:20030919T090000
656 DTEND;VALUE=DATE-TIME:20030919T113000
657 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
659 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long"
660 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long"
661 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long")
662 (icalendar-testsuite--test-import
663 "SUMMARY:rrule count bi-weekly 3 times
664 DTSTART;VALUE=DATE-TIME:20030919T090000
665 DTEND;VALUE=DATE-TIME:20030919T113000
666 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
668 "&%%(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"
669 "&%%(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"
670 "&%%(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")
671 (icalendar-testsuite--test-import
672 "SUMMARY:rrule count monthly
673 DTSTART;VALUE=DATE-TIME:20030919T090000
674 DTEND;VALUE=DATE-TIME:20030919T113000
675 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
677 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly"
678 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly"
679 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly")
680 (icalendar-testsuite--test-import
681 "SUMMARY:rrule count every second month
682 DTSTART;VALUE=DATE-TIME:20030919T090000
683 DTEND;VALUE=DATE-TIME:20030919T113000
684 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
686 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month" ;FIXME
687 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME
688 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME
689 (icalendar-testsuite--test-import
690 "SUMMARY:rrule count yearly
691 DTSTART;VALUE=DATE-TIME:20030919T090000
692 DTEND;VALUE=DATE-TIME:20030919T113000
693 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
695 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly"
696 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly"
697 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly")
698 (icalendar-testsuite--test-import
699 "SUMMARY:rrule count every second year
700 DTSTART;VALUE=DATE-TIME:20030919T090000
701 DTEND;VALUE=DATE-TIME:20030919T113000
702 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
704 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year" ;FIXME!!!
705 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!!
706 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!!
708 ;; duration
709 (icalendar-testsuite--test-import
710 "DTSTART;VALUE=DATE:20050217
711 SUMMARY:duration
712 DURATION:P7D
714 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration"
715 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration"
716 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration")
718 (icalendar-testsuite--test-import
719 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
720 DTSTAMP:20041127T183315Z
721 LAST-MODIFIED:20041127T183329
722 SUMMARY:Urlaub
723 DTSTART;VALUE=DATE:20011221
724 DTEND;VALUE=DATE:20011221
725 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
726 CLASS:PUBLIC
727 SEQUENCE:1
728 CREATED:20041127T183329
730 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub"
731 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub"
732 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub")
735 ;; ======================================================================
736 ;; Export tests
737 ;; ======================================================================
738 (defun icalendar-testsuite--run-export-tests ()
739 "Perform standard export tests."
741 (let ((icalendar-export-hidden-diary-entries nil))
742 (icalendar-testsuite--test-export
743 "&2000 Oct 3 ordinary no time "
744 "&3 Okt 2000 ordinary no time "
745 "&Oct 3 2000 ordinary no time "
746 nil))
748 ;; "ordinary" events
749 (icalendar-testsuite--test-export
750 "2000 Oct 3 ordinary no time "
751 "3 Okt 2000 ordinary no time "
752 "Oct 3 2000 ordinary no time "
753 "DTSTART;VALUE=DATE:20001003
754 DTEND;VALUE=DATE:20001004
755 SUMMARY:ordinary no time
757 (icalendar-testsuite--test-export
758 "2000 Oct 3 16:30 ordinary with time"
759 "3 Okt 2000 16:30 ordinary with time"
760 "Oct 3 2000 16:30 ordinary with time"
761 "DTSTART;VALUE=DATE-TIME:20001003T163000
762 DTEND;VALUE=DATE-TIME:20001003T173000
763 SUMMARY:ordinary with time
765 (icalendar-testsuite--test-export
766 "2000 10 3 16:30 ordinary with time 2"
767 "3 10 2000 16:30 ordinary with time 2"
768 "10 3 2000 16:30 ordinary with time 2"
769 "DTSTART;VALUE=DATE-TIME:20001003T163000
770 DTEND;VALUE=DATE-TIME:20001003T173000
771 SUMMARY:ordinary with time 2
774 (icalendar-testsuite--test-export
775 "2000/10/3 16:30 ordinary with time 3"
776 "3/10/2000 16:30 ordinary with time 3"
777 "10/3/2000 16:30 ordinary with time 3"
778 "DTSTART;VALUE=DATE-TIME:20001003T163000
779 DTEND;VALUE=DATE-TIME:20001003T173000
780 SUMMARY:ordinary with time 3
783 ;; multiline -- FIXME!!!
784 (icalendar-testsuite--test-export
785 "2000 October 3 16:30 multiline
786 17:30 multiline continued FIXME"
787 "3 Oktober 2000 16:30 multiline
788 17:30 multiline continued FIXME"
789 "October 3 2000 16:30 multiline
790 17:30 multiline continued FIXME"
791 "DTSTART;VALUE=DATE-TIME:20001003T163000
792 DTEND;VALUE=DATE-TIME:20001003T173000
793 SUMMARY:multiline
794 DESCRIPTION:
795 17:30 multiline continued FIXME
798 ;; weekly by day
799 (icalendar-testsuite--test-export
800 "Monday 1:30pm weekly by day with start time"
801 "Montag 13:30 weekly by day with start time"
802 "Monday 1:30pm weekly by day with start time"
803 "DTSTART;VALUE=DATE-TIME:20000103T133000
804 DTEND;VALUE=DATE-TIME:20000103T143000
805 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
806 SUMMARY:weekly by day with start time
809 (icalendar-testsuite--test-export
810 "Monday 13:30-15:00 weekly by day with start and end time"
811 "Montag 13:30-15:00 weekly by day with start and end time"
812 "Monday 01:30pm-03:00pm weekly by day with start and end time"
813 "DTSTART;VALUE=DATE-TIME:20000103T133000
814 DTEND;VALUE=DATE-TIME:20000103T150000
815 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
816 SUMMARY:weekly by day with start and end time
819 ;; yearly
820 (icalendar-testsuite--test-export
821 "may 1 yearly no time"
822 "1 Mai yearly no time"
823 "may 1 yearly no time"
824 "DTSTART;VALUE=DATE:19000501
825 DTEND;VALUE=DATE:19000502
826 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
827 SUMMARY:yearly no time
830 ;; anniversaries
831 (icalendar-testsuite--test-export
832 "%%(diary-anniversary 1989 10 3) anniversary no time"
833 "%%(diary-anniversary 3 10 1989) anniversary no time"
834 "%%(diary-anniversary 10 3 1989) anniversary no time"
835 "DTSTART;VALUE=DATE:19891003
836 DTEND;VALUE=DATE:19891004
837 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
838 SUMMARY:anniversary no time
840 (icalendar-testsuite--test-export
841 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
842 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
843 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
844 "DTSTART;VALUE=DATE-TIME:19891003T190000
845 DTEND;VALUE=DATE-TIME:19891004T200000
846 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
847 SUMMARY:anniversary with time
850 ;; block
851 (icalendar-testsuite--test-export
852 "%%(diary-block 2001 6 18 2001 7 6) block no time"
853 "%%(diary-block 18 6 2001 6 7 2001) block no time"
854 "%%(diary-block 6 18 2001 7 6 2001) block no time"
855 "DTSTART;VALUE=DATE:20010618
856 DTEND;VALUE=DATE:20010707
857 SUMMARY:block no time
859 (icalendar-testsuite--test-export
860 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
861 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
862 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
863 "DTSTART;VALUE=DATE-TIME:20010618T130000
864 DTEND;VALUE=DATE-TIME:20010618T170000
865 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
866 SUMMARY:block with time
868 (icalendar-testsuite--test-export
869 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
870 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
871 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
872 "DTSTART;VALUE=DATE-TIME:20010618T130000
873 DTEND;VALUE=DATE-TIME:20010618T140000
874 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
875 SUMMARY:block no end time
879 ;; ======================================================================
880 ;; Real world
881 ;; ======================================================================
882 (defun icalendar-testsuite--run-real-world-tests ()
883 "Perform real-world tests, as gathered from problem reports."
884 ;; 2003-05-29
885 (icalendar-testsuite--test-import
886 "BEGIN:VCALENDAR
887 METHOD:REQUEST
888 PRODID:Microsoft CDO for Microsoft Exchange
889 VERSION:2.0
890 BEGIN:VTIMEZONE
891 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
892 X-MICROSOFT-CDO-TZID:23
893 BEGIN:STANDARD
894 DTSTART:16010101T000000
895 TZOFFSETFROM:+0530
896 TZOFFSETTO:+0530
897 END:STANDARD
898 BEGIN:DAYLIGHT
899 DTSTART:16010101T000000
900 TZOFFSETFROM:+0530
901 TZOFFSETTO:+0530
902 END:DAYLIGHT
903 END:VTIMEZONE
904 BEGIN:VEVENT
905 DTSTAMP:20030509T043439Z
906 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
907 SUMMARY:On-Site Interview
908 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
909 010000000DB823520692542408ED02D7023F9DFF9
910 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
911 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
912 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
913 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
914 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
915 zz\":MAILTO:zzzzzz@zzzzzzz.com
916 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
917 LOCATION:Cccc
918 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
919 DESCRIPTION:10:30am - Blah
920 SEQUENCE:0
921 PRIORITY:5
922 CLASS:
923 CREATED:20030509T043439Z
924 LAST-MODIFIED:20030509T043459Z
925 STATUS:CONFIRMED
926 TRANSP:OPAQUE
927 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
928 X-MICROSOFT-CDO-INSTTYPE:0
929 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
930 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
931 X-MICROSOFT-CDO-IMPORTANCE:1
932 X-MICROSOFT-CDO-OWNERAPPTID:126441427
933 BEGIN:VALARM
934 ACTION:DISPLAY
935 DESCRIPTION:REMINDER
936 TRIGGER;RELATED=START:-PT00H15M00S
937 END:VALARM
938 END:VEVENT
939 END:VCALENDAR"
941 "&9/5/2003 10:30-15:30 On-Site Interview
942 Desc: 10:30am - Blah
943 Location: Cccc
944 Organizer: MAILTO:aaaaaaa@aaaaaaa.com"
945 "&5/9/2003 10:30-15:30 On-Site Interview
946 Desc: 10:30am - Blah
947 Location: Cccc
948 Organizer: MAILTO:aaaaaaa@aaaaaaa.com")
950 ;; 2003-06-18 a
951 (icalendar-testsuite--test-import
952 "DTSTAMP:20030618T195512Z
953 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
954 SUMMARY:Dress Rehearsal for XXXX-XXXX
955 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
956 0100000007C3A6D65EE726E40B7F3D69A23BD567E
957 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
958 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
959 ORGANIZER;CN=\"ABCD,TECHTRAINING
960 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
961 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
962 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
963 DESCRIPTION:753 Zeichen hier radiert
964 SEQUENCE:0
965 PRIORITY:5
966 CLASS:
967 CREATED:20030618T195518Z
968 LAST-MODIFIED:20030618T195527Z
969 STATUS:CONFIRMED
970 TRANSP:OPAQUE
971 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
972 X-MICROSOFT-CDO-INSTTYPE:0
973 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
974 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
975 X-MICROSOFT-CDO-IMPORTANCE:1
976 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
977 BEGIN:VALARM
978 ACTION:DISPLAY
979 DESCRIPTION:REMINDER
980 TRIGGER;RELATED=START:-PT00H15M00S
981 END:VALARM"
983 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
984 Desc: 753 Zeichen hier radiert
985 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
986 Organizer: MAILTO:xxx@xxxxx.com"
987 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
988 Desc: 753 Zeichen hier radiert
989 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
990 Organizer: MAILTO:xxx@xxxxx.com")
992 ;; 2003-06-18 b -- uses timezone
993 (icalendar-testsuite--test-import
994 "BEGIN:VCALENDAR
995 METHOD:REQUEST
996 PRODID:Microsoft CDO for Microsoft Exchange
997 VERSION:2.0
998 BEGIN:VTIMEZONE
999 TZID:Mountain Time (US & Canada)
1000 X-MICROSOFT-CDO-TZID:12
1001 BEGIN:STANDARD
1002 DTSTART:16010101T020000
1003 TZOFFSETFROM:-0600
1004 TZOFFSETTO:-0700
1005 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1006 END:STANDARD
1007 BEGIN:DAYLIGHT
1008 DTSTART:16010101T020000
1009 TZOFFSETFROM:-0700
1010 TZOFFSETTO:-0600
1011 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1012 END:DAYLIGHT
1013 END:VTIMEZONE
1014 BEGIN:VEVENT
1015 DTSTAMP:20030618T230323Z
1016 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1017 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1018 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1019 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1020 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1021 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1022 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1023 .com
1024 ORGANIZER;CN=\"ABCD,TECHTRAINING
1025 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1026 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1027 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1028 DESCRIPTION:Viele Zeichen standen hier früher
1029 SEQUENCE:0
1030 PRIORITY:5
1031 CLASS:
1032 CREATED:20030618T230326Z
1033 LAST-MODIFIED:20030618T230335Z
1034 STATUS:CONFIRMED
1035 TRANSP:OPAQUE
1036 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1037 X-MICROSOFT-CDO-INSTTYPE:0
1038 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1039 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1040 X-MICROSOFT-CDO-IMPORTANCE:1
1041 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1042 BEGIN:VALARM
1043 ACTION:DISPLAY
1044 DESCRIPTION:REMINDER
1045 TRIGGER;RELATED=START:-PT00H15M00S
1046 END:VALARM
1047 END:VEVENT
1048 END:VCALENDAR"
1050 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1051 Desc: Viele Zeichen standen hier früher
1052 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1053 Organizer: MAILTO:bbb@bbbbb.com
1054 Status: CONFIRMED"
1055 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1056 Desc: Viele Zeichen standen hier früher
1057 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1058 Organizer: MAILTO:bbb@bbbbb.com
1059 Status: CONFIRMED")
1061 ;; export 2004-10-28 block entries
1062 (icalendar-testsuite--test-export
1065 "-*- mode: text; fill-column: 256;-*-
1067 >>> block entries:
1069 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1071 "DTSTART;VALUE=DATE:20041108
1072 DTEND;VALUE=DATE:20041111
1073 SUMMARY:Nov 8-10 aa")
1075 (icalendar-testsuite--test-export
1078 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1079 "DTSTART;VALUE=DATE:20041213
1080 DTEND;VALUE=DATE:20041218
1081 SUMMARY:Dec 13-17 bb")
1083 (icalendar-testsuite--test-export
1086 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1087 "DTSTART;VALUE=DATE:20050203
1088 DTEND;VALUE=DATE:20050205
1089 SUMMARY:Feb 3-4 cc")
1091 (icalendar-testsuite--test-export
1094 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1095 "DTSTART;VALUE=DATE:20050424
1096 DTEND;VALUE=DATE:20050430
1097 SUMMARY:April 24-29 dd
1099 (icalendar-testsuite--test-export
1102 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1103 "DTSTART;VALUE=DATE:20050530
1104 DTEND;VALUE=DATE:20050602
1105 SUMMARY:may 30 - June 1: ee")
1107 (icalendar-testsuite--test-export
1110 "%%(diary-block 6 6 2005 6 8 2005) ff"
1111 "DTSTART;VALUE=DATE:20050606
1112 DTEND;VALUE=DATE:20050609
1113 SUMMARY:ff")
1115 ;; export 2004-10-28 anniversary entries
1116 (icalendar-testsuite--test-export
1120 >>> anniversaries:
1122 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1123 "DTSTART;VALUE=DATE:19910328
1124 DTEND;VALUE=DATE:19910329
1125 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1126 SUMMARY:aa birthday (%d years old)
1129 (icalendar-testsuite--test-export
1132 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1133 "DTSTART;VALUE=DATE:19570517
1134 DTEND;VALUE=DATE:19570518
1135 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1136 SUMMARY:bb birthday (%d years old)")
1138 (icalendar-testsuite--test-export
1141 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1142 "DTSTART;VALUE=DATE:19970608
1143 DTEND;VALUE=DATE:19970609
1144 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1145 SUMMARY:cc birthday (%d years old)")
1147 (icalendar-testsuite--test-export
1150 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1151 "DTSTART;VALUE=DATE:19830722
1152 DTEND;VALUE=DATE:19830723
1153 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1154 SUMMARY:dd (%d years ago...!)")
1156 (icalendar-testsuite--test-export
1159 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1160 "DTSTART;VALUE=DATE:19880801
1161 DTEND;VALUE=DATE:19880802
1162 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1163 SUMMARY:ee birthday (%d years old)")
1165 (icalendar-testsuite--test-export
1168 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1169 "DTSTART;VALUE=DATE:19570921
1170 DTEND;VALUE=DATE:19570922
1171 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1172 SUMMARY:ff birthday (%d years old)")
1175 ;; FIXME!
1177 ;; export 2004-10-28 monthly, weekly entries
1179 ;; (icalendar-testsuite--test-export
1180 ;; nil
1181 ;; "
1182 ;; >>> ------------ monthly:
1184 ;; */27/* 10:00 blah blah"
1185 ;; "xxx")
1187 (icalendar-testsuite--test-export
1190 ">>> ------------ my week:
1192 Monday 13:00 MAC"
1193 "DTSTART;VALUE=DATE-TIME:20000103T130000
1194 DTEND;VALUE=DATE-TIME:20000103T140000
1195 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1196 SUMMARY:MAC")
1198 (icalendar-testsuite--test-export
1201 "Monday 15:00 a1"
1202 "DTSTART;VALUE=DATE-TIME:20000103T150000
1203 DTEND;VALUE=DATE-TIME:20000103T160000
1204 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1205 SUMMARY:a1")
1208 (icalendar-testsuite--test-export
1211 "Monday 16:00-17:00 a2"
1212 "DTSTART;VALUE=DATE-TIME:20000103T160000
1213 DTEND;VALUE=DATE-TIME:20000103T170000
1214 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1215 SUMMARY:a2")
1217 (icalendar-testsuite--test-export
1220 "Tuesday 11:30-13:00 a3"
1221 "DTSTART;VALUE=DATE-TIME:20000104T113000
1222 DTEND;VALUE=DATE-TIME:20000104T130000
1223 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1224 SUMMARY:a3")
1226 (icalendar-testsuite--test-export
1229 "Tuesday 15:00 a4"
1230 "DTSTART;VALUE=DATE-TIME:20000104T150000
1231 DTEND;VALUE=DATE-TIME:20000104T160000
1232 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1233 SUMMARY:a4")
1235 (icalendar-testsuite--test-export
1238 "Wednesday 13:00 a5"
1239 "DTSTART;VALUE=DATE-TIME:20000105T130000
1240 DTEND;VALUE=DATE-TIME:20000105T140000
1241 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1242 SUMMARY:a5")
1244 (icalendar-testsuite--test-export
1247 "Wednesday 11:30-13:30 a6"
1248 "DTSTART;VALUE=DATE-TIME:20000105T113000
1249 DTEND;VALUE=DATE-TIME:20000105T133000
1250 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1251 SUMMARY:a6")
1253 (icalendar-testsuite--test-export
1256 "Wednesday 15:00 s1"
1257 "DTSTART;VALUE=DATE-TIME:20000105T150000
1258 DTEND;VALUE=DATE-TIME:20000105T160000
1259 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1260 SUMMARY:s1")
1263 ;; export 2004-10-28 regular entries
1264 (icalendar-testsuite--test-export
1268 >>> regular diary entries:
1270 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1271 "DTSTART;VALUE=DATE-TIME:20041012T140000
1272 DTEND;VALUE=DATE-TIME:20041012T150000
1273 SUMMARY:Tue: [2004-10-12] q1")
1275 ;; 2004-11-19
1276 (icalendar-testsuite--test-import
1277 "BEGIN:VCALENDAR
1278 VERSION
1279 :2.0
1280 PRODID
1281 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1282 BEGIN:VEVENT
1284 :04979712-3902-11d9-93dd-8f9f4afe08da
1285 SUMMARY
1286 :Jjjjj & Wwwww
1287 STATUS
1288 :TENTATIVE
1289 CLASS
1290 :PRIVATE
1291 X-MOZILLA-ALARM-DEFAULT-LENGTH
1293 DTSTART
1294 :20041123T140000
1295 DTEND
1296 :20041123T143000
1297 DTSTAMP
1298 :20041118T013430Z
1299 LAST-MODIFIED
1300 :20041118T013640Z
1301 END:VEVENT
1302 BEGIN:VEVENT
1304 :6161a312-3902-11d9-b512-f764153bb28b
1305 SUMMARY
1306 :BB Aaaaaaaa Bbbbb
1307 STATUS
1308 :TENTATIVE
1309 CLASS
1310 :PRIVATE
1311 X-MOZILLA-ALARM-DEFAULT-LENGTH
1313 DTSTART
1314 :20041123T144500
1315 DTEND
1316 :20041123T154500
1317 DTSTAMP
1318 :20041118T013641Z
1319 END:VEVENT
1320 BEGIN:VEVENT
1322 :943a4d7e-3902-11d9-9ce7-c9addeadf928
1323 SUMMARY
1324 :Hhhhhhhh
1325 STATUS
1326 :TENTATIVE
1327 CLASS
1328 :PRIVATE
1329 X-MOZILLA-ALARM-DEFAULT-LENGTH
1331 DTSTART
1332 :20041123T110000
1333 DTEND
1334 :20041123T120000
1335 DTSTAMP
1336 :20041118T013831Z
1337 END:VEVENT
1338 BEGIN:VEVENT
1340 :fe53615e-3902-11d9-9dd8-9d38a155bf41
1341 SUMMARY
1342 :MMM Aaaaaaaaa
1343 STATUS
1344 :TENTATIVE
1345 CLASS
1346 :PRIVATE
1347 X-MOZILLA-ALARM-DEFAULT-LENGTH
1349 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1351 RRULE
1352 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1353 DTSTART
1354 :20041112T140000
1355 DTEND
1356 :20041112T183000
1357 DTSTAMP
1358 :20041118T014117Z
1359 END:VEVENT
1360 BEGIN:VEVENT
1362 :87c928ee-3901-11d9-b21f-b45042155024
1363 SUMMARY
1364 :Rrrr/Cccccc ii Aaaaaaaa
1365 DESCRIPTION
1366 :Vvvvv Rrrr aaa Cccccc
1367 STATUS
1368 :TENTATIVE
1369 CLASS
1370 :PRIVATE
1371 X-MOZILLA-ALARM-DEFAULT-LENGTH
1373 DTSTART
1374 ;VALUE=DATE
1375 :20041119
1376 DTEND
1377 ;VALUE=DATE
1378 :20041120
1379 DTSTAMP
1380 :20041118T013107Z
1381 LAST-MODIFIED
1382 :20041118T014203Z
1383 END:VEVENT
1384 BEGIN:VEVENT
1386 :e8f331ae-3902-11d9-9948-dfdcb66a2872
1387 SUMMARY
1388 :Wwww aa hhhh
1389 STATUS
1390 :TENTATIVE
1391 CLASS
1392 :PRIVATE
1393 X-MOZILLA-ALARM-DEFAULT-LENGTH
1395 RRULE
1396 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1397 DTSTART
1398 ;VALUE=DATE
1399 :20041101
1400 DTEND
1401 ;VALUE=DATE
1402 :20041102
1403 DTSTAMP
1404 :20041118T014045Z
1405 LAST-MODIFIED
1406 :20041118T023846Z
1407 END:VEVENT
1408 END:VCALENDAR
1411 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1412 Status: TENTATIVE
1413 Class: PRIVATE
1414 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1415 Status: TENTATIVE
1416 Class: PRIVATE
1417 &23/11/2004 11:00-12:00 Hhhhhhhh
1418 Status: TENTATIVE
1419 Class: PRIVATE
1420 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1421 Status: TENTATIVE
1422 Class: PRIVATE
1423 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1424 Desc: Vvvvv Rrrr aaa Cccccc
1425 Status: TENTATIVE
1426 Class: PRIVATE
1427 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1428 Status: TENTATIVE
1429 Class: PRIVATE "
1430 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1431 Status: TENTATIVE
1432 Class: PRIVATE
1433 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1434 Status: TENTATIVE
1435 Class: PRIVATE
1436 &11/23/2004 11:00-12:00 Hhhhhhhh
1437 Status: TENTATIVE
1438 Class: PRIVATE
1439 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1440 Status: TENTATIVE
1441 Class: PRIVATE
1442 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1443 Desc: Vvvvv Rrrr aaa Cccccc
1444 Status: TENTATIVE
1445 Class: PRIVATE
1446 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1447 Status: TENTATIVE
1448 Class: PRIVATE ")
1450 ;; 2004-09-09 pg
1451 (icalendar-testsuite--test-export
1452 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1455 "DTSTART;VALUE=DATE:20040101
1456 DTEND;VALUE=DATE:20040105
1457 SUMMARY:Urlaub")
1459 ;; 2004-10-25 pg
1460 (icalendar-testsuite--test-export
1462 "5 11 2004 Bla Fasel"
1464 "DTSTART;VALUE=DATE:20041105
1465 DTEND;VALUE=DATE:20041106
1466 SUMMARY:Bla Fasel")
1468 ;; 2004-10-30 pg
1469 (icalendar-testsuite--test-export
1471 "2 Nov 2004 15:00-16:30 Zahnarzt"
1473 "DTSTART;VALUE=DATE-TIME:20041102T150000
1474 DTEND;VALUE=DATE-TIME:20041102T163000
1475 SUMMARY:Zahnarzt")
1477 ;; 2005-02-07 lt
1478 (icalendar-testsuite--test-import
1479 "UID
1480 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1481 SUMMARY
1482 :Waitangi Day
1483 DESCRIPTION
1484 :abcdef
1485 CATEGORIES
1486 :Public Holiday
1487 STATUS
1488 :CONFIRMED
1489 CLASS
1490 :PRIVATE
1491 DTSTART
1492 ;VALUE=DATE
1493 :20050206
1494 DTEND
1495 ;VALUE=DATE
1496 :20050207
1497 DTSTAMP
1498 :20050128T011209Z"
1500 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1501 Desc: abcdef"
1502 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1503 Desc: abcdef")
1505 ;; 2005-03-01 lt
1506 (icalendar-testsuite--test-import
1507 "DTSTART;VALUE=DATE:20050217
1508 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1509 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1510 DTSTAMP:20050118T210335Z
1511 DURATION:P7D"
1513 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa"
1514 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa")
1516 ;; 2005-03-23 lt
1517 (icalendar-testsuite--test-export
1519 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1521 "DTSTART;VALUE=DATE-TIME:20050208T160000
1522 DTEND;VALUE=DATE-TIME:20050208T164500
1523 RRULE:FREQ=DAILY;INTERVAL=7
1524 SUMMARY:[WORK] Pppp
1527 ;; 2005-05-27 eu
1528 (icalendar-testsuite--test-export
1531 ;; FIXME: colon not allowed!
1532 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1533 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1534 "DTSTART;VALUE=DATE:19001101
1535 DTEND;VALUE=DATE:19001102
1536 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1537 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1541 (defun icalendar-testsuite--run-cycle-tests ()
1542 "Perform cycling tests."
1543 (icalendar-testsuite--test-cycle
1544 "DTSTART;VALUE=DATE-TIME:20030919T090000
1545 DTEND;VALUE=DATE-TIME:20030919T113000
1546 SUMMARY:Cycletest
1549 (icalendar-testsuite--test-cycle
1550 "DTSTART;VALUE=DATE-TIME:20030919T090000
1551 DTEND;VALUE=DATE-TIME:20030919T113000
1552 SUMMARY:Cycletest
1553 DESCRIPTION:beschreibung!
1554 LOCATION:nowhere
1555 ORGANIZER:ulf
1558 ;; FIXME: does not work
1559 ;; (icalendar-testsuite--test-cycle
1560 ;; "DTSTART;VALUE=DATE:19190909
1561 ;;DTEND;VALUE=DATE:19190910
1562 ;;RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1563 ;;SUMMARY:and diary-anniversary
1564 ;;")
1568 (provide 'icalendar-testsuite)
1570 ;; arch-tag: 33a98396-90e9-49c8-b0e9-b606386d6e8c
1571 ;;; icalendar-testsuite.el ends here