* image-dired.el (image-dired-dired-toggle-marked-thumbs):
[emacs.git] / test / icalendar-testsuite.el
blob012f586c342794fd045f3113ca70718eab861ef9
1 ;; icalendar-testsuite.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008, 2009, 2010 Free Software Foundation, Inc.
5 ;; Author: Ulf Jasper <ulf.jasper@web.de>
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-convert-ordinary-to-ical)
56 (icalendar-testsuite--test-convert-weekly-to-ical)
57 (icalendar-testsuite--test-convert-yearly-to-ical)
58 (icalendar-testsuite--test-convert-block-to-ical)
59 (icalendar-testsuite--test-convert-cyclic-to-ical)
60 (icalendar-testsuite--test-convert-anniversary-to-ical)
61 (icalendar-testsuite--test-calendar-style)
62 (icalendar-testsuite--test-create-uid)
63 (icalendar-testsuite--test-parse-vtimezone))
65 (defun icalendar-testsuite--test-format-ical-event ()
66 "Test `icalendar--format-ical-event'."
67 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
68 (icalendar-import-format-summary "SUM %s")
69 (icalendar-import-format-location " LOC %s")
70 (icalendar-import-format-description " DES %s")
71 (icalendar-import-format-organizer " ORG %s")
72 (icalendar-import-format-status " STA %s")
73 (icalendar-import-format-url " URL %s")
74 (icalendar-import-format-class " CLA %s")
75 (event (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
76 DTSTAMP:20030509T043439Z
77 DTSTART:20030509T103000
78 SUMMARY:sum
79 ORGANIZER:org
80 LOCATION:loc
81 DTEND:20030509T153000
82 DESCRIPTION:des
83 END:VEVENT
84 ")))
85 (assert (string= (icalendar--format-ical-event event)
86 "SUM sum DES des LOC loc ORG org") t)
87 (setq icalendar-import-format (lambda (&rest ignore)
88 "helloworld"))
89 (assert (string= (icalendar--format-ical-event event)
90 "helloworld") t)
91 (setq icalendar-import-format
92 (lambda (e)
93 (format "-%s-%s-%s-%s-%s-%s-%s-"
94 (icalendar--get-event-property event 'SUMMARY)
95 (icalendar--get-event-property event 'DESCRIPTION)
96 (icalendar--get-event-property event 'LOCATION)
97 (icalendar--get-event-property event 'ORGANIZER)
98 (icalendar--get-event-property event 'STATUS)
99 (icalendar--get-event-property event 'URL)
100 (icalendar--get-event-property event 'CLASS))))
101 (assert (string= (icalendar--format-ical-event event)
102 "-sum-des-loc-org-nil-nil-nil-") t)))
104 (defun icalendar-testsuite--test-parse-summary-and-rest ()
105 "Test `icalendar--parse-summary-and-rest'."
106 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
107 (icalendar-import-format-summary "SUM %s")
108 (icalendar-import-format-location " LOC %s")
109 (icalendar-import-format-description " DES %s")
110 (icalendar-import-format-organizer " ORG %s")
111 (icalendar-import-format-status " STA %s")
112 (icalendar-import-format-url " URL %s")
113 (icalendar-import-format-class " CLA %s")
114 (result))
115 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org"))
116 (assert (string= (cdr (assoc 'org result)) "org"))
118 (setq result (icalendar--parse-summary-and-rest
119 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
120 (assert (string= (cdr (assoc 'des result)) "des"))
121 (assert (string= (cdr (assoc 'loc result)) "loc"))
122 (assert (string= (cdr (assoc 'org result)) "org"))
123 (assert (string= (cdr (assoc 'sta result)) "sta"))
124 (assert (string= (cdr (assoc 'cla result)) "cla"))
126 (setq icalendar-import-format (lambda () "Hello world"))
127 (setq result (icalendar--parse-summary-and-rest
128 "blah blah "))
129 (assert (not result))
132 (defun icalendar-testsuite--get-ical-event (ical-string)
133 "Helper function for testing `icalendar-testsuite--test-format-ical-event'.
134 Return icalendar event for ICAL-STRING."
135 (save-excursion
136 (with-temp-buffer
137 (insert ical-string)
138 (goto-char (point-min))
139 (car (icalendar--read-element nil nil)))))
141 (defun icalendar-testsuite--test-import-format-sample ()
142 "Test method for `icalendar-import-format-sample'."
143 (assert (string= (icalendar-import-format-sample
144 (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
145 DTSTAMP:20030509T043439Z
146 DTSTART:20030509T103000
147 SUMMARY:a
148 ORGANIZER:d
149 LOCATION:c
150 DTEND:20030509T153000
151 DESCRIPTION:b
152 END:VEVENT
154 (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
155 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'"))))
157 (defun icalendar-testsuite--test-first-weekday-of-year ()
158 "Test method for `icalendar-first-weekday-of-year'."
159 (assert (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
160 (assert (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
161 (assert (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
162 (assert (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
163 (assert (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
164 (assert (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
165 (assert (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
166 (assert (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
167 (assert (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
169 (defun icalendar-testsuite--test-datestring-to-isodate ()
170 "Test method for `icalendar--datestring-to-isodate'."
171 (let ((calendar-date-style 'iso))
172 ;; numeric iso
173 (assert (string= (icalendar--datestring-to-isodate "2008 05 11")
174 "20080511"))
175 (assert (string= (icalendar--datestring-to-isodate "2008 05 31")
176 "20080531"))
177 (assert (string= (icalendar--datestring-to-isodate "2008 05 31" 2)
178 "20080602"))
180 ;; numeric european
181 (setq calendar-date-style 'european)
182 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
183 "20080511"))
184 (assert (string= (icalendar--datestring-to-isodate "31 05 2008")
185 "20080531"))
186 (assert (string= (icalendar--datestring-to-isodate "31 05 2008" 2)
187 "20080602"))
189 ;; numeric american
190 (setq calendar-date-style 'american)
191 (assert (string= (icalendar--datestring-to-isodate "11 05 2008")
192 "20081105"))
193 (assert (string= (icalendar--datestring-to-isodate "12 30 2008")
194 "20081230"))
195 (assert (string= (icalendar--datestring-to-isodate "12 30 2008" 2)
196 "20090101"))
198 ;; non-numeric
199 (setq calendar-date-style nil) ;not necessary for conversion
200 (assert (string= (icalendar--datestring-to-isodate "Nov 05 2008")
201 "20081105"))
202 (assert (string= (icalendar--datestring-to-isodate "05 Nov 2008")
203 "20081105"))
204 (assert (string= (icalendar--datestring-to-isodate "2008 Nov 05")
205 "20081105"))))
207 (defun icalendar-testsuite--test-datetime-to-diary-date ()
208 "Test method for `icalendar--datetime-to-diary-date'."
209 (let* ((datetime '(59 59 23 31 12 2008))
210 (calendar-date-style 'iso))
211 (assert (string= (icalendar--datetime-to-diary-date datetime)
212 "2008 12 31"))
213 (setq calendar-date-style 'european)
214 (assert (string= (icalendar--datetime-to-diary-date datetime)
215 "31 12 2008"))
216 (setq calendar-date-style 'american)
217 (assert (string= (icalendar--datetime-to-diary-date datetime)
218 "12 31 2008"))))
220 (defun icalendar-testsuite--test-diarytime-to-isotime ()
221 "Test method for `icalendar--diarytime-to-isotime'."
222 (assert (string= (icalendar--diarytime-to-isotime "01:15" "")
223 "T011500"))
224 (assert (string= (icalendar--diarytime-to-isotime "1:15" "")
225 "T011500"))
226 (assert (string= (icalendar--diarytime-to-isotime "0:01" "")
227 "T000100"))
228 (assert (string= (icalendar--diarytime-to-isotime "0100" "")
229 "T010000"))
230 (assert (string= (icalendar--diarytime-to-isotime "0100" "am")
231 "T010000"))
232 (assert (string= (icalendar--diarytime-to-isotime "0100" "pm")
233 "T130000"))
234 (assert (string= (icalendar--diarytime-to-isotime "1200" "")
235 "T120000"))
236 (assert (string= (icalendar--diarytime-to-isotime "17:17" "")
237 "T171700"))
238 (assert (string= (icalendar--diarytime-to-isotime "1200" "am")
239 "T000000"))
240 (assert (string= (icalendar--diarytime-to-isotime "1201" "am")
241 "T000100"))
242 (assert (string= (icalendar--diarytime-to-isotime "1259" "am")
243 "T005900"))
244 (assert (string= (icalendar--diarytime-to-isotime "1200" "pm")
245 "T120000"))
246 (assert (string= (icalendar--diarytime-to-isotime "1201" "pm")
247 "T120100"))
248 (assert (string= (icalendar--diarytime-to-isotime "1259" "pm")
249 "T125900")))
251 (defun icalendar-testsuite--test-convert-ordinary-to-ical ()
252 "Test method for `icalendar--convert-ordinary-to-ical'."
253 (let* ((calendar-date-style 'iso)
254 result)
255 ;; without time
256 (setq result (icalendar--convert-ordinary-to-ical "&?" "2010 2 15 subject"))
257 (assert (= 2 (length result)))
258 (assert (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216"
259 (car result)))
260 (assert (string= "subject" (cadr result)))
262 ;; with time
263 (setq result (icalendar--convert-ordinary-to-ical
264 "&?" "&2010 2 15 12:34-23:45 s"))
265 (assert (= 2 (length result)))
266 (assert (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
267 "\nDTEND;VALUE=DATE-TIME:20100215T234500")
268 (car result)))
269 (assert (string= "s" (cadr result)))
271 ;; with time, again -- test bug#5549
272 (setq result (icalendar--convert-ordinary-to-ical
273 "x?" "x2010 2 15 0:34-1:45 s"))
274 (assert (= 2 (length result)))
275 (assert (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400"
276 "\nDTEND;VALUE=DATE-TIME:20100215T014500")
277 (car result)))
278 (assert (string= "s" (cadr result)))))
280 (defun icalendar-testsuite--test-convert-weekly-to-ical ()
281 "Test method for `icalendar--convert-weekly-to-ical'."
282 (let* ((calendar-date-style 'iso)
283 result
284 (calendar-day-name-array
285 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
286 "Saturday"]))
287 (setq result (icalendar--convert-weekly-to-ical "" "Monday 8:30 subject"))
288 (assert (= 2 (length result)))
289 (assert (string= (concat "\nDTSTART;VALUE=DATE-TIME:20050103T083000"
290 "\nDTEND;VALUE=DATE-TIME:20050103T093000"
291 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO")
292 (car result)))
293 (assert (string= "subject" (cadr result)))))
295 (defun icalendar-testsuite--test-convert-yearly-to-ical ()
296 "Test method for `icalendar--convert-yearly-to-ical'."
297 (let* ((calendar-date-style 'iso)
298 result
299 (calendar-month-name-array
300 ["January" "February" "March" "April" "May" "June" "July" "August"
301 "September" "October" "November" "December"]))
302 (setq result (icalendar--convert-yearly-to-ical "" "May 1 Tag der Arbeit"))
303 (assert (= 2 (length result)))
304 (assert (string= (concat
305 "\nDTSTART;VALUE=DATE:19000501"
306 "\nDTEND;VALUE=DATE:19000502"
307 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1")
308 (car result)))
309 (assert (string= "Tag der Arbeit" (cadr result)))))
311 (defun icalendar-testsuite--test-convert-block-to-ical ()
312 "Test method for `icalendar--convert-block-to-ical'."
313 (let* ((calendar-date-style 'iso)
314 result)
315 (setq result (icalendar--convert-block-to-ical
316 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
317 (assert (= 2 (length result)))
318 (assert (string= (concat
319 "\nDTSTART;VALUE=DATE:20040719"
320 "\nDTEND;VALUE=DATE:20040828")
321 (car result)))
322 (assert (string= "Sommerferien" (cadr result)))))
324 (defun icalendar-testsuite--test-convert-cyclic-to-ical ()
325 "Test method for `icalendar--convert-cyclic-to-ical'."
326 (let* ((calendar-date-style 'iso)
327 result)
328 (setq result (icalendar--convert-block-to-ical
329 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
330 (assert (= 2 (length result)))
331 (assert (string= (concat
332 "\nDTSTART;VALUE=DATE:20040719"
333 "\nDTEND;VALUE=DATE:20040828")
334 (car result)))
335 (assert (string= "Sommerferien" (cadr result)))))
337 (defun icalendar-testsuite--test-convert-anniversary-to-ical ()
338 "Test method for `icalendar--convert-anniversary-to-ical'."
339 (let* ((calendar-date-style 'iso)
340 result)
341 (setq result (icalendar--convert-anniversary-to-ical
342 "" "%%(diary-anniversary 1964 6 30) g"))
343 (assert (= 2 (length result)))
344 (assert (string= (concat
345 "\nDTSTART;VALUE=DATE:19640630"
346 "\nDTEND;VALUE=DATE:19640701"
347 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=30")
348 (car result)))
349 (assert (string= "g" (cadr result)))))
351 (defun icalendar-testsuite--test-calendar-style ()
352 "Test method for `icalendar--date-style'."
353 (dolist (calendar-date-style '(iso american european))
354 (assert (eq (icalendar--date-style) calendar-date-style)))
355 (let ((cds calendar-date-style)
356 (european-calendar-style t))
357 (makunbound 'calendar-date-style)
358 (assert (eq (icalendar--date-style) 'european))
359 (with-no-warnings (setq european-calendar-style nil)) ;still get warning!?! FIXME
360 (assert (eq (icalendar--date-style) 'american))
361 (setq calendar-date-style cds)))
363 (defun icalendar-testsuite--test-create-uid ()
364 "Test method for `icalendar--create-uid'."
365 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
366 t-ct
367 (icalendar--uid-count 77)
368 (entry-full "30.06.1964 07:01 blahblah")
369 (hash (format "%d" (abs (sxhash entry-full))))
370 (contents "DTSTART:19640630T070100\nblahblah")
371 (username (or user-login-name "UNKNOWN_USER"))
373 ;; FIXME! If a test fails 'current-time is screwed. FIXME!
374 (fset 't-ct (symbol-function 'current-time))
375 (fset 'current-time (lambda () '(1 2 3)))
376 (assert (= 77 icalendar--uid-count))
377 (assert (string= (concat "xxx-123-77-" hash "-" username "-19640630")
378 (icalendar--create-uid entry-full contents)))
379 (assert (= 78 icalendar--uid-count))
380 (fset 'current-time (symbol-function 't-ct))
382 (setq contents "blahblah")
383 (setq icalendar-uid-format "yyy%syyy")
384 (assert (string= (concat "yyyDTSTARTyyy")
385 (icalendar--create-uid entry-full contents)))
388 (defun icalendar-testsuite--test-parse-vtimezone ()
389 (let (vtimezone result)
390 (setq vtimezone (icalendar-testsuite--get-ical-event "BEGIN:VTIMEZONE
391 TZID:thename
392 BEGIN:STANDARD
393 DTSTART:16010101T040000
394 TZOFFSETFROM:+0300
395 TZOFFSETTO:+0200
396 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
397 END:STANDARD
398 BEGIN:DAYLIGHT
399 DTSTART:16010101T030000
400 TZOFFSETFROM:+0200
401 TZOFFSETTO:+0300
402 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
403 END:DAYLIGHT
404 END:VTIMEZONE
406 (setq result (icalendar--parse-vtimezone vtimezone))
407 (assert (string= "thename" (car result)))
408 (message (cdr result))
409 (assert (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00" (cdr result)))
410 (setq vtimezone (icalendar-testsuite--get-ical-event "BEGIN:VTIMEZONE
411 TZID:anothername
412 BEGIN:STANDARD
413 DTSTART:16010101T040000
414 TZOFFSETFROM:+0300
415 TZOFFSETTO:+0200
416 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
417 END:STANDARD
418 BEGIN:DAYLIGHT
419 DTSTART:16010101T030000
420 TZOFFSETFROM:+0200
421 TZOFFSETTO:+0300
422 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
423 END:DAYLIGHT
424 END:VTIMEZONE
426 (setq result (icalendar--parse-vtimezone vtimezone))
427 (assert (string= "anothername" (car result)))
428 (message (cdr result))
429 (assert (string= "STD-02:00DST-03:00,M3.2.1/03:00:00,M10.2.1/04:00:00" (cdr result)))))
431 ;; ======================================================================
432 ;; Test methods for exporting from diary to icalendar
433 ;; ======================================================================
435 (defun icalendar-testsuite--test-export (input-iso input-european input-american
436 expected-output)
437 "Perform an export test.
438 Argument INPUT-ISO iso style diary string.
439 Argument INPUT-EUROPEAN european style diary string.
440 Argument INPUT-AMERICAN american style diary string.
441 Argument EXPECTED-OUTPUT expected icalendar result string.
443 European style input data must use german month names. American
444 and ISO style input data must use english month names."
445 (message "--- icalendar-testsuite--test-export ---")
446 (let ((calendar-date-style 'iso)
447 (icalendar-recurring-start-year 2000))
448 (set-time-zone-rule "CET") ;;FIXME: reset timezone!
449 (when input-iso
450 (let ((calendar-month-name-array
451 ["January" "February" "March" "April" "May" "June" "July" "August"
452 "September" "October" "November" "December"])
453 (calendar-day-name-array
454 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
455 "Saturday"]))
456 (setq calendar-date-style 'iso)
457 (icalendar-testsuite--do-test-export input-iso expected-output)))
458 (when input-european
459 (let ((calendar-month-name-array
460 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
461 "September" "Oktober" "November" "Dezember"])
462 (calendar-day-name-array
463 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
464 "Samstag"]))
465 (setq calendar-date-style 'european)
466 (icalendar-testsuite--do-test-export input-european expected-output)))
467 (when input-american
468 (let ((calendar-month-name-array
469 ["January" "February" "March" "April" "May" "June" "July" "August"
470 "September" "October" "November" "December"])
471 (calendar-day-name-array
472 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
473 "Saturday"]))
474 (setq calendar-date-style 'american)
475 (icalendar-testsuite--do-test-export input-american expected-output)))))
477 (defun icalendar-testsuite--do-test-export (input expected-output)
478 "Actually perform export test.
479 Argument INPUT input diary string.
480 Argument EXPECTED-OUTPUT expected icalendar result string."
481 (let ((temp-file (make-temp-file "icalendar-testsuite-ics")))
482 (with-temp-buffer
483 (insert input)
484 (icalendar-export-region (point-min) (point-max) temp-file))
485 (save-excursion
486 (find-file temp-file)
487 (goto-char (point-min))
488 (unless
489 (cond (expected-output
490 (and (re-search-forward "^\\s-*BEGIN:VCALENDAR
491 PRODID:-//Emacs//NONSGML icalendar.el//EN
492 VERSION:2.0
493 BEGIN:VEVENT
494 UID:emacs[0-9]+
495 \\(\\(.\\|\n\\)+\\)
496 END:VEVENT
497 END:VCALENDAR
498 \\s-*$"
499 nil t)
500 (string-match
501 (concat "^\\s-*"
502 (regexp-quote (buffer-substring-no-properties
503 (match-beginning 1) (match-end 1)))
504 "\\s-*$")
505 expected-output)))
507 (re-search-forward "^\\s-*BEGIN:VCALENDAR
508 PRODID:-//Emacs//NONSGML icalendar.el//EN
509 VERSION:2.0
510 END:VCALENDAR
511 \\s-*$"
512 nil t)))
513 (error
514 "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s"
515 input
516 (or (and (match-beginning 1)
517 (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
518 "<nil>")
519 (or expected-output "<nil>"))))
520 (kill-buffer (find-buffer-visiting temp-file))
521 (delete-file temp-file)))
523 ;; ======================================================================
524 ;; Test methods for importing from icalendar to diary
525 ;; ======================================================================
527 (defun icalendar-testsuite--test-import (input expected-iso expected-european
528 expected-american)
529 "Perform import test.
530 Argument INPUT icalendar event string.
531 Argument EXPECTED-ISO expected iso style diary string.
532 Argument EXPECTED-EUROPEAN expected european style diary string.
533 Argument EXPECTED-AMERICAN expected american style diary string."
534 (message "--- icalendar-testsuite--test-import ---")
535 (let ((timezone (cadr (current-time-zone))))
536 (set-time-zone-rule "CET")
537 (with-temp-buffer
538 (if (string-match "^BEGIN:VCALENDAR" input)
539 (insert input)
540 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
541 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
542 (insert input)
543 (unless (eq (char-before) ?\n)
544 (insert "\n"))
545 (insert "END:VEVENT\nEND:VCALENDAR\n"))
546 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
547 (icalendar-import-format-summary "%s")
548 (icalendar-import-format-location "\n Location: %s")
549 (icalendar-import-format-description "\n Desc: %s")
550 (icalendar-import-format-organizer "\n Organizer: %s")
551 (icalendar-import-format-status "\n Status: %s")
552 (icalendar-import-format-url "\n URL: %s")
553 (icalendar-import-format-class "\n Class: %s")
554 calendar-date-style)
555 (when expected-iso
556 (setq calendar-date-style 'iso)
557 (icalendar-testsuite--do-test-import input expected-iso))
558 (when expected-european
559 (setq calendar-date-style 'european)
560 (icalendar-testsuite--do-test-import input expected-european))
561 (when expected-american
562 (setq calendar-date-style 'american)
563 (icalendar-testsuite--do-test-import input expected-american))))
564 (set-time-zone-rule timezone)))
566 (defun icalendar-testsuite--do-test-import (input expected-output)
567 "Actually perform import test.
568 Argument INPUT input icalendar string.
569 Argument EXPECTED-OUTPUT expected diary string."
570 (let ((temp-file (make-temp-file "icalendar-test-diary")))
571 (icalendar-import-buffer temp-file t t)
572 (save-excursion
573 (find-file temp-file)
574 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
575 (unless (string-match (concat "^\\s-*" expected-output "\\s-*$")
576 result)
577 (error "Import test failed! Found `%s'\nbut expected `%s'" result
578 expected-output)))
579 (kill-buffer (find-buffer-visiting temp-file))
580 (delete-file temp-file))))
582 ;; ======================================================================
583 ;; Test methods for cycle...
584 ;; ======================================================================
585 (defun icalendar-testsuite--test-cycle (input)
586 "Perform cycle test.
587 Argument INPUT icalendar event string."
588 (with-temp-buffer
589 (if (string-match "^BEGIN:VCALENDAR" input)
590 (insert input)
591 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
592 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
593 (insert input)
594 (unless (eq (char-before) ?\n)
595 (insert "\n"))
596 (insert "END:VEVENT\nEND:VCALENDAR\n"))
597 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
598 (icalendar-import-format-summary "%s")
599 (icalendar-import-format-location "\n Location: %s")
600 (icalendar-import-format-description "\n Desc: %s")
601 (icalendar-import-format-organizer "\n Organizer: %s")
602 (icalendar-import-format-status "\n Status: %s")
603 (icalendar-import-format-url "\n URL: %s")
604 (icalendar-import-format-class "\n Class: %s"))
605 (dolist (calendar-date-style '(iso european american))
606 (icalendar-testsuite--do-test-cycle)))))
608 (defun icalendar-testsuite--do-test-cycle ()
609 "Actually perform import/export cycle test."
610 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
611 (temp-ics (make-temp-file "icalendar-test-ics"))
612 (org-input (buffer-substring-no-properties (point-min) (point-max))))
614 ;; step 1: import
615 (icalendar-import-buffer temp-diary t t)
617 ;; step 2: export what was just imported
618 (save-excursion
619 (find-file temp-diary)
620 (icalendar-export-region (point-min) (point-max) temp-ics))
622 ;; compare the output of step 2 with the input of step 1
623 (save-excursion
624 (find-file temp-ics)
625 (goto-char (point-min))
626 (when (re-search-forward "\nUID:.*\n" nil t)
627 (replace-match "\n"))
628 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
629 (unless (string-equal org-input cycled)
630 (error "Import test failed! Found `%s'\nbut expected `%s'" cycled
631 org-input))))
633 ;; clean up -- Note this is done only if test is passed
634 (kill-buffer (find-buffer-visiting temp-diary))
635 (save-excursion
636 (set-buffer (find-buffer-visiting temp-ics))
637 (set-buffer-modified-p nil)
638 (kill-buffer (current-buffer)))
639 (delete-file temp-diary)
640 (delete-file temp-ics)))
642 ;; ======================================================================
643 ;; Import tests
644 ;; ======================================================================
645 (defun icalendar-testsuite--run-import-tests ()
646 "Perform standard import tests."
647 (icalendar-testsuite--test-import
648 "SUMMARY:non-recurring
649 DTSTART;VALUE=DATE-TIME:20030919T090000
650 DTEND;VALUE=DATE-TIME:20030919T113000"
651 "&2003/9/19 09:00-11:30 non-recurring"
652 "&19/9/2003 09:00-11:30 non-recurring"
653 "&9/19/2003 09:00-11:30 non-recurring")
655 (icalendar-testsuite--test-import
656 "SUMMARY:non-recurring allday
657 DTSTART;VALUE=DATE-TIME:20030919"
658 "&2003/9/19 non-recurring allday"
659 "&19/9/2003 non-recurring allday"
660 "&9/19/2003 non-recurring allday")
662 (icalendar-testsuite--test-import
663 "SUMMARY:long
664 summary
665 DTSTART;VALUE=DATE:20030919"
666 "&2003/9/19 long summary"
667 "&19/9/2003 long summary"
668 "&9/19/2003 long summary")
670 (icalendar-testsuite--test-import
671 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
672 SUMMARY:Sommerferien
673 STATUS:TENTATIVE
674 CLASS:PRIVATE
675 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
676 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
677 DTSTART;VALUE=DATE:20040719
678 DTEND;VALUE=DATE:20040828
679 DTSTAMP:20031103T011641Z
681 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien"
682 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien"
683 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien")
685 (icalendar-testsuite--test-import
686 "UID
687 :04979712-3902-11d9-93dd-8f9f4afe08da
688 SUMMARY
689 :folded summary
690 STATUS
691 :TENTATIVE
692 CLASS
693 :PRIVATE
694 X-MOZILLA-ALARM-DEFAULT-LENGTH
696 DTSTART
697 :20041123T140000
698 DTEND
699 :20041123T143000
700 DTSTAMP
701 :20041118T013430Z
702 LAST-MODIFIED
703 :20041118T013640Z
705 "&2004/11/23 14:00-14:30 folded summary"
706 "&23/11/2004 14:00-14:30 folded summary"
707 "&11/23/2004 14:00-14:30 folded summary")
708 (icalendar-testsuite--test-import
709 "UID
710 :6161a312-3902-11d9-b512-f764153bb28b
711 SUMMARY
712 :another example
713 STATUS
714 :TENTATIVE
715 CLASS
716 :PRIVATE
717 X-MOZILLA-ALARM-DEFAULT-LENGTH
719 DTSTART
720 :20041123T144500
721 DTEND
722 :20041123T154500
723 DTSTAMP
724 :20041118T013641Z
726 "&2004/11/23 14:45-15:45 another example"
727 "&23/11/2004 14:45-15:45 another example"
728 "&11/23/2004 14:45-15:45 another example")
730 (icalendar-testsuite--test-import
731 "SUMMARY:rrule daily
732 DTSTART;VALUE=DATE-TIME:20030919T090000
733 DTEND;VALUE=DATE-TIME:20030919T113000
734 RRULE:FREQ=DAILY;
736 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily"
737 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily"
738 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily")
740 ;; RRULE examples
741 (icalendar-testsuite--test-import
742 "SUMMARY:rrule daily
743 DTSTART;VALUE=DATE-TIME:20030919T090000
744 DTEND;VALUE=DATE-TIME:20030919T113000
745 RRULE:FREQ=DAILY;INTERVAL=2
747 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily"
748 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily"
749 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily")
750 (icalendar-testsuite--test-import
751 "SUMMARY:rrule daily with exceptions
752 DTSTART;VALUE=DATE-TIME:20030919T090000
753 DTEND;VALUE=DATE-TIME:20030919T113000
754 RRULE:FREQ=DAILY;INTERVAL=2
755 EXDATE:20030921,20030925
757 "&%%(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"
758 "&%%(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"
759 "&%%(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")
761 (icalendar-testsuite--test-import
762 "SUMMARY:rrule weekly
763 DTSTART;VALUE=DATE-TIME:20030919T090000
764 DTEND;VALUE=DATE-TIME:20030919T113000
765 RRULE:FREQ=WEEKLY;
767 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly"
768 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly"
769 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly")
770 (icalendar-testsuite--test-import
771 "SUMMARY:rrule monthly no end
772 DTSTART;VALUE=DATE-TIME:20030919T090000
773 DTEND;VALUE=DATE-TIME:20030919T113000
774 RRULE:FREQ=MONTHLY;
776 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end"
777 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end"
778 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end")
779 (icalendar-testsuite--test-import
780 "SUMMARY:rrule monthly with end
781 DTSTART;VALUE=DATE-TIME:20030919T090000
782 DTEND;VALUE=DATE-TIME:20030919T113000
783 RRULE:FREQ=MONTHLY;UNTIL=20050819;
785 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end"
786 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end"
787 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end")
788 (icalendar-testsuite--test-import
789 "DTSTART;VALUE=DATE:20040815
790 DTEND;VALUE=DATE:20040816
791 SUMMARY:Maria Himmelfahrt
792 UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
793 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
795 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt"
796 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt"
797 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt")
798 (icalendar-testsuite--test-import
799 "SUMMARY:rrule yearly
800 DTSTART;VALUE=DATE-TIME:20030919T090000
801 DTEND;VALUE=DATE-TIME:20030919T113000
802 RRULE:FREQ=YEARLY;INTERVAL=2
804 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly" ;FIXME
805 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME
806 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME
807 (icalendar-testsuite--test-import
808 "SUMMARY:rrule count daily short
809 DTSTART;VALUE=DATE-TIME:20030919T090000
810 DTEND;VALUE=DATE-TIME:20030919T113000
811 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
813 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short"
814 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short"
815 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short")
816 (icalendar-testsuite--test-import
817 "SUMMARY:rrule count daily long
818 DTSTART;VALUE=DATE-TIME:20030919T090000
819 DTEND;VALUE=DATE-TIME:20030919T113000
820 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
822 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long"
823 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long"
824 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long")
825 (icalendar-testsuite--test-import
826 "SUMMARY:rrule count bi-weekly 3 times
827 DTSTART;VALUE=DATE-TIME:20030919T090000
828 DTEND;VALUE=DATE-TIME:20030919T113000
829 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
831 "&%%(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"
832 "&%%(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"
833 "&%%(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")
834 (icalendar-testsuite--test-import
835 "SUMMARY:rrule count monthly
836 DTSTART;VALUE=DATE-TIME:20030919T090000
837 DTEND;VALUE=DATE-TIME:20030919T113000
838 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
840 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly"
841 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly"
842 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly")
843 (icalendar-testsuite--test-import
844 "SUMMARY:rrule count every second month
845 DTSTART;VALUE=DATE-TIME:20030919T090000
846 DTEND;VALUE=DATE-TIME:20030919T113000
847 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
849 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month" ;FIXME
850 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME
851 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME
852 (icalendar-testsuite--test-import
853 "SUMMARY:rrule count yearly
854 DTSTART;VALUE=DATE-TIME:20030919T090000
855 DTEND;VALUE=DATE-TIME:20030919T113000
856 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
858 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly"
859 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly"
860 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly")
861 (icalendar-testsuite--test-import
862 "SUMMARY:rrule count every second year
863 DTSTART;VALUE=DATE-TIME:20030919T090000
864 DTEND;VALUE=DATE-TIME:20030919T113000
865 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
867 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year" ;FIXME!!!
868 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!!
869 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!!
871 ;; duration
872 (icalendar-testsuite--test-import
873 "DTSTART;VALUE=DATE:20050217
874 SUMMARY:duration
875 DURATION:P7D
877 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration"
878 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration"
879 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration")
881 (icalendar-testsuite--test-import
882 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
883 DTSTAMP:20041127T183315Z
884 LAST-MODIFIED:20041127T183329
885 SUMMARY:Urlaub
886 DTSTART;VALUE=DATE:20011221
887 DTEND;VALUE=DATE:20011221
888 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
889 CLASS:PUBLIC
890 SEQUENCE:1
891 CREATED:20041127T183329
893 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub"
894 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub"
895 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub")
898 ;; ======================================================================
899 ;; Export tests
900 ;; ======================================================================
901 (defun icalendar-testsuite--run-export-tests ()
902 "Perform standard export tests."
904 (let ((icalendar-export-hidden-diary-entries nil))
905 (icalendar-testsuite--test-export
906 "&2000 Oct 3 ordinary no time "
907 "&3 Okt 2000 ordinary no time "
908 "&Oct 3 2000 ordinary no time "
909 nil))
911 ;; "ordinary" events
912 (icalendar-testsuite--test-export
913 "2000 Oct 3 ordinary no time "
914 "3 Okt 2000 ordinary no time "
915 "Oct 3 2000 ordinary no time "
916 "DTSTART;VALUE=DATE:20001003
917 DTEND;VALUE=DATE:20001004
918 SUMMARY:ordinary no time
920 (icalendar-testsuite--test-export
921 "2000 Oct 3 16:30 ordinary with time"
922 "3 Okt 2000 16:30 ordinary with time"
923 "Oct 3 2000 16:30 ordinary with time"
924 "DTSTART;VALUE=DATE-TIME:20001003T163000
925 DTEND;VALUE=DATE-TIME:20001003T173000
926 SUMMARY:ordinary with time
928 (icalendar-testsuite--test-export
929 "2000 10 3 16:30 ordinary with time 2"
930 "3 10 2000 16:30 ordinary with time 2"
931 "10 3 2000 16:30 ordinary with time 2"
932 "DTSTART;VALUE=DATE-TIME:20001003T163000
933 DTEND;VALUE=DATE-TIME:20001003T173000
934 SUMMARY:ordinary with time 2
937 (icalendar-testsuite--test-export
938 "2000/10/3 16:30 ordinary with time 3"
939 "3/10/2000 16:30 ordinary with time 3"
940 "10/3/2000 16:30 ordinary with time 3"
941 "DTSTART;VALUE=DATE-TIME:20001003T163000
942 DTEND;VALUE=DATE-TIME:20001003T173000
943 SUMMARY:ordinary with time 3
946 ;; multiline -- FIXME!!!
947 (icalendar-testsuite--test-export
948 "2000 October 3 16:30 multiline
949 17:30 multiline continued FIXME"
950 "3 Oktober 2000 16:30 multiline
951 17:30 multiline continued FIXME"
952 "October 3 2000 16:30 multiline
953 17:30 multiline continued FIXME"
954 "DTSTART;VALUE=DATE-TIME:20001003T163000
955 DTEND;VALUE=DATE-TIME:20001003T173000
956 SUMMARY:multiline
957 DESCRIPTION:
958 17:30 multiline continued FIXME
961 ;; weekly by day
962 (icalendar-testsuite--test-export
963 "Monday 1:30pm weekly by day with start time"
964 "Montag 13:30 weekly by day with start time"
965 "Monday 1:30pm weekly by day with start time"
966 "DTSTART;VALUE=DATE-TIME:20000103T133000
967 DTEND;VALUE=DATE-TIME:20000103T143000
968 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
969 SUMMARY:weekly by day with start time
972 (icalendar-testsuite--test-export
973 "Monday 13:30-15:00 weekly by day with start and end time"
974 "Montag 13:30-15:00 weekly by day with start and end time"
975 "Monday 01:30pm-03:00pm weekly by day with start and end time"
976 "DTSTART;VALUE=DATE-TIME:20000103T133000
977 DTEND;VALUE=DATE-TIME:20000103T150000
978 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
979 SUMMARY:weekly by day with start and end time
982 ;; yearly
983 (icalendar-testsuite--test-export
984 "may 1 yearly no time"
985 "1 Mai yearly no time"
986 "may 1 yearly no time"
987 "DTSTART;VALUE=DATE:19000501
988 DTEND;VALUE=DATE:19000502
989 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
990 SUMMARY:yearly no time
993 ;; anniversaries
994 (icalendar-testsuite--test-export
995 "%%(diary-anniversary 1989 10 3) anniversary no time"
996 "%%(diary-anniversary 3 10 1989) anniversary no time"
997 "%%(diary-anniversary 10 3 1989) anniversary no time"
998 "DTSTART;VALUE=DATE:19891003
999 DTEND;VALUE=DATE:19891004
1000 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
1001 SUMMARY:anniversary no time
1003 (icalendar-testsuite--test-export
1004 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
1005 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
1006 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
1007 "DTSTART;VALUE=DATE-TIME:19891003T190000
1008 DTEND;VALUE=DATE-TIME:19891004T200000
1009 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
1010 SUMMARY:anniversary with time
1013 ;; block
1014 (icalendar-testsuite--test-export
1015 "%%(diary-block 2001 6 18 2001 7 6) block no time"
1016 "%%(diary-block 18 6 2001 6 7 2001) block no time"
1017 "%%(diary-block 6 18 2001 7 6 2001) block no time"
1018 "DTSTART;VALUE=DATE:20010618
1019 DTEND;VALUE=DATE:20010707
1020 SUMMARY:block no time
1022 (icalendar-testsuite--test-export
1023 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
1024 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
1025 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
1026 "DTSTART;VALUE=DATE-TIME:20010618T130000
1027 DTEND;VALUE=DATE-TIME:20010618T170000
1028 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
1029 SUMMARY:block with time
1031 (icalendar-testsuite--test-export
1032 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
1033 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
1034 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
1035 "DTSTART;VALUE=DATE-TIME:20010618T130000
1036 DTEND;VALUE=DATE-TIME:20010618T140000
1037 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
1038 SUMMARY:block no end time
1042 ;; ======================================================================
1043 ;; Real world
1044 ;; ======================================================================
1045 (defun icalendar-testsuite--run-real-world-tests ()
1046 "Perform real-world tests, as gathered from problem reports."
1047 ;; 2003-05-29
1048 (icalendar-testsuite--test-import
1049 "BEGIN:VCALENDAR
1050 METHOD:REQUEST
1051 PRODID:Microsoft CDO for Microsoft Exchange
1052 VERSION:2.0
1053 BEGIN:VTIMEZONE
1054 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
1055 X-MICROSOFT-CDO-TZID:23
1056 BEGIN:STANDARD
1057 DTSTART:16010101T000000
1058 TZOFFSETFROM:+0530
1059 TZOFFSETTO:+0530
1060 END:STANDARD
1061 BEGIN:DAYLIGHT
1062 DTSTART:16010101T000000
1063 TZOFFSETFROM:+0530
1064 TZOFFSETTO:+0530
1065 END:DAYLIGHT
1066 END:VTIMEZONE
1067 BEGIN:VEVENT
1068 DTSTAMP:20030509T043439Z
1069 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1070 SUMMARY:On-Site Interview
1071 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1072 010000000DB823520692542408ED02D7023F9DFF9
1073 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1074 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1075 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1076 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1077 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1078 zz\":MAILTO:zzzzzz@zzzzzzz.com
1079 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1080 LOCATION:Cccc
1081 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1082 DESCRIPTION:10:30am - Blah
1083 SEQUENCE:0
1084 PRIORITY:5
1085 CLASS:
1086 CREATED:20030509T043439Z
1087 LAST-MODIFIED:20030509T043459Z
1088 STATUS:CONFIRMED
1089 TRANSP:OPAQUE
1090 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1091 X-MICROSOFT-CDO-INSTTYPE:0
1092 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1093 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1094 X-MICROSOFT-CDO-IMPORTANCE:1
1095 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1096 BEGIN:VALARM
1097 ACTION:DISPLAY
1098 DESCRIPTION:REMINDER
1099 TRIGGER;RELATED=START:-PT00H15M00S
1100 END:VALARM
1101 END:VEVENT
1102 END:VCALENDAR"
1104 "&9/5/2003 10:30-15:30 On-Site Interview
1105 Desc: 10:30am - Blah
1106 Location: Cccc
1107 Organizer: MAILTO:aaaaaaa@aaaaaaa.com"
1108 "&5/9/2003 10:30-15:30 On-Site Interview
1109 Desc: 10:30am - Blah
1110 Location: Cccc
1111 Organizer: MAILTO:aaaaaaa@aaaaaaa.com")
1113 ;; 2003-06-18 a
1114 (icalendar-testsuite--test-import
1115 "DTSTAMP:20030618T195512Z
1116 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1117 SUMMARY:Dress Rehearsal for XXXX-XXXX
1118 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1119 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1120 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1121 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1122 ORGANIZER;CN=\"ABCD,TECHTRAINING
1123 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1124 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1125 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1126 DESCRIPTION:753 Zeichen hier radiert
1127 SEQUENCE:0
1128 PRIORITY:5
1129 CLASS:
1130 CREATED:20030618T195518Z
1131 LAST-MODIFIED:20030618T195527Z
1132 STATUS:CONFIRMED
1133 TRANSP:OPAQUE
1134 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1135 X-MICROSOFT-CDO-INSTTYPE:0
1136 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1137 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1138 X-MICROSOFT-CDO-IMPORTANCE:1
1139 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1140 BEGIN:VALARM
1141 ACTION:DISPLAY
1142 DESCRIPTION:REMINDER
1143 TRIGGER;RELATED=START:-PT00H15M00S
1144 END:VALARM"
1146 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1147 Desc: 753 Zeichen hier radiert
1148 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1149 Organizer: MAILTO:xxx@xxxxx.com"
1150 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1151 Desc: 753 Zeichen hier radiert
1152 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1153 Organizer: MAILTO:xxx@xxxxx.com")
1155 ;; 2003-06-18 b -- uses timezone
1156 (icalendar-testsuite--test-import
1157 "BEGIN:VCALENDAR
1158 METHOD:REQUEST
1159 PRODID:Microsoft CDO for Microsoft Exchange
1160 VERSION:2.0
1161 BEGIN:VTIMEZONE
1162 TZID:Mountain Time (US & Canada)
1163 X-MICROSOFT-CDO-TZID:12
1164 BEGIN:STANDARD
1165 DTSTART:16010101T020000
1166 TZOFFSETFROM:-0600
1167 TZOFFSETTO:-0700
1168 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1169 END:STANDARD
1170 BEGIN:DAYLIGHT
1171 DTSTART:16010101T020000
1172 TZOFFSETFROM:-0700
1173 TZOFFSETTO:-0600
1174 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1175 END:DAYLIGHT
1176 END:VTIMEZONE
1177 BEGIN:VEVENT
1178 DTSTAMP:20030618T230323Z
1179 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1180 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1181 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1182 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1183 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1184 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1185 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1186 .com
1187 ORGANIZER;CN=\"ABCD,TECHTRAINING
1188 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1189 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1190 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1191 DESCRIPTION:Viele Zeichen standen hier früher
1192 SEQUENCE:0
1193 PRIORITY:5
1194 CLASS:
1195 CREATED:20030618T230326Z
1196 LAST-MODIFIED:20030618T230335Z
1197 STATUS:CONFIRMED
1198 TRANSP:OPAQUE
1199 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1200 X-MICROSOFT-CDO-INSTTYPE:0
1201 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1202 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1203 X-MICROSOFT-CDO-IMPORTANCE:1
1204 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1205 BEGIN:VALARM
1206 ACTION:DISPLAY
1207 DESCRIPTION:REMINDER
1208 TRIGGER;RELATED=START:-PT00H15M00S
1209 END:VALARM
1210 END:VEVENT
1211 END:VCALENDAR"
1213 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1214 Desc: Viele Zeichen standen hier früher
1215 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1216 Organizer: MAILTO:bbb@bbbbb.com
1217 Status: CONFIRMED"
1218 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1219 Desc: Viele Zeichen standen hier früher
1220 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1221 Organizer: MAILTO:bbb@bbbbb.com
1222 Status: CONFIRMED")
1224 ;; export 2004-10-28 block entries
1225 (icalendar-testsuite--test-export
1228 "-*- mode: text; fill-column: 256;-*-
1230 >>> block entries:
1232 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1234 "DTSTART;VALUE=DATE:20041108
1235 DTEND;VALUE=DATE:20041111
1236 SUMMARY:Nov 8-10 aa")
1238 (icalendar-testsuite--test-export
1241 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1242 "DTSTART;VALUE=DATE:20041213
1243 DTEND;VALUE=DATE:20041218
1244 SUMMARY:Dec 13-17 bb")
1246 (icalendar-testsuite--test-export
1249 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1250 "DTSTART;VALUE=DATE:20050203
1251 DTEND;VALUE=DATE:20050205
1252 SUMMARY:Feb 3-4 cc")
1254 (icalendar-testsuite--test-export
1257 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1258 "DTSTART;VALUE=DATE:20050424
1259 DTEND;VALUE=DATE:20050430
1260 SUMMARY:April 24-29 dd
1262 (icalendar-testsuite--test-export
1265 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1266 "DTSTART;VALUE=DATE:20050530
1267 DTEND;VALUE=DATE:20050602
1268 SUMMARY:may 30 - June 1: ee")
1270 (icalendar-testsuite--test-export
1273 "%%(diary-block 6 6 2005 6 8 2005) ff"
1274 "DTSTART;VALUE=DATE:20050606
1275 DTEND;VALUE=DATE:20050609
1276 SUMMARY:ff")
1278 ;; export 2004-10-28 anniversary entries
1279 (icalendar-testsuite--test-export
1283 >>> anniversaries:
1285 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1286 "DTSTART;VALUE=DATE:19910328
1287 DTEND;VALUE=DATE:19910329
1288 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1289 SUMMARY:aa birthday (%d years old)
1292 (icalendar-testsuite--test-export
1295 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1296 "DTSTART;VALUE=DATE:19570517
1297 DTEND;VALUE=DATE:19570518
1298 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1299 SUMMARY:bb birthday (%d years old)")
1301 (icalendar-testsuite--test-export
1304 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1305 "DTSTART;VALUE=DATE:19970608
1306 DTEND;VALUE=DATE:19970609
1307 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1308 SUMMARY:cc birthday (%d years old)")
1310 (icalendar-testsuite--test-export
1313 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1314 "DTSTART;VALUE=DATE:19830722
1315 DTEND;VALUE=DATE:19830723
1316 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1317 SUMMARY:dd (%d years ago...!)")
1319 (icalendar-testsuite--test-export
1322 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1323 "DTSTART;VALUE=DATE:19880801
1324 DTEND;VALUE=DATE:19880802
1325 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1326 SUMMARY:ee birthday (%d years old)")
1328 (icalendar-testsuite--test-export
1331 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1332 "DTSTART;VALUE=DATE:19570921
1333 DTEND;VALUE=DATE:19570922
1334 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1335 SUMMARY:ff birthday (%d years old)")
1338 ;; FIXME!
1340 ;; export 2004-10-28 monthly, weekly entries
1342 ;; (icalendar-testsuite--test-export
1343 ;; nil
1344 ;; "
1345 ;; >>> ------------ monthly:
1347 ;; */27/* 10:00 blah blah"
1348 ;; "xxx")
1350 (icalendar-testsuite--test-export
1353 ">>> ------------ my week:
1355 Monday 13:00 MAC"
1356 "DTSTART;VALUE=DATE-TIME:20000103T130000
1357 DTEND;VALUE=DATE-TIME:20000103T140000
1358 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1359 SUMMARY:MAC")
1361 (icalendar-testsuite--test-export
1364 "Monday 15:00 a1"
1365 "DTSTART;VALUE=DATE-TIME:20000103T150000
1366 DTEND;VALUE=DATE-TIME:20000103T160000
1367 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1368 SUMMARY:a1")
1371 (icalendar-testsuite--test-export
1374 "Monday 16:00-17:00 a2"
1375 "DTSTART;VALUE=DATE-TIME:20000103T160000
1376 DTEND;VALUE=DATE-TIME:20000103T170000
1377 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1378 SUMMARY:a2")
1380 (icalendar-testsuite--test-export
1383 "Tuesday 11:30-13:00 a3"
1384 "DTSTART;VALUE=DATE-TIME:20000104T113000
1385 DTEND;VALUE=DATE-TIME:20000104T130000
1386 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1387 SUMMARY:a3")
1389 (icalendar-testsuite--test-export
1392 "Tuesday 15:00 a4"
1393 "DTSTART;VALUE=DATE-TIME:20000104T150000
1394 DTEND;VALUE=DATE-TIME:20000104T160000
1395 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1396 SUMMARY:a4")
1398 (icalendar-testsuite--test-export
1401 "Wednesday 13:00 a5"
1402 "DTSTART;VALUE=DATE-TIME:20000105T130000
1403 DTEND;VALUE=DATE-TIME:20000105T140000
1404 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1405 SUMMARY:a5")
1407 (icalendar-testsuite--test-export
1410 "Wednesday 11:30-13:30 a6"
1411 "DTSTART;VALUE=DATE-TIME:20000105T113000
1412 DTEND;VALUE=DATE-TIME:20000105T133000
1413 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1414 SUMMARY:a6")
1416 (icalendar-testsuite--test-export
1419 "Wednesday 15:00 s1"
1420 "DTSTART;VALUE=DATE-TIME:20000105T150000
1421 DTEND;VALUE=DATE-TIME:20000105T160000
1422 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1423 SUMMARY:s1")
1426 ;; export 2004-10-28 regular entries
1427 (icalendar-testsuite--test-export
1431 >>> regular diary entries:
1433 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1434 "DTSTART;VALUE=DATE-TIME:20041012T140000
1435 DTEND;VALUE=DATE-TIME:20041012T150000
1436 SUMMARY:Tue: [2004-10-12] q1")
1438 ;; 2004-11-19
1439 (icalendar-testsuite--test-import
1440 "BEGIN:VCALENDAR
1441 VERSION
1442 :2.0
1443 PRODID
1444 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1445 BEGIN:VEVENT
1447 :04979712-3902-11d9-93dd-8f9f4afe08da
1448 SUMMARY
1449 :Jjjjj & Wwwww
1450 STATUS
1451 :TENTATIVE
1452 CLASS
1453 :PRIVATE
1454 X-MOZILLA-ALARM-DEFAULT-LENGTH
1456 DTSTART
1457 :20041123T140000
1458 DTEND
1459 :20041123T143000
1460 DTSTAMP
1461 :20041118T013430Z
1462 LAST-MODIFIED
1463 :20041118T013640Z
1464 END:VEVENT
1465 BEGIN:VEVENT
1467 :6161a312-3902-11d9-b512-f764153bb28b
1468 SUMMARY
1469 :BB Aaaaaaaa Bbbbb
1470 STATUS
1471 :TENTATIVE
1472 CLASS
1473 :PRIVATE
1474 X-MOZILLA-ALARM-DEFAULT-LENGTH
1476 DTSTART
1477 :20041123T144500
1478 DTEND
1479 :20041123T154500
1480 DTSTAMP
1481 :20041118T013641Z
1482 END:VEVENT
1483 BEGIN:VEVENT
1485 :943a4d7e-3902-11d9-9ce7-c9addeadf928
1486 SUMMARY
1487 :Hhhhhhhh
1488 STATUS
1489 :TENTATIVE
1490 CLASS
1491 :PRIVATE
1492 X-MOZILLA-ALARM-DEFAULT-LENGTH
1494 DTSTART
1495 :20041123T110000
1496 DTEND
1497 :20041123T120000
1498 DTSTAMP
1499 :20041118T013831Z
1500 END:VEVENT
1501 BEGIN:VEVENT
1503 :fe53615e-3902-11d9-9dd8-9d38a155bf41
1504 SUMMARY
1505 :MMM Aaaaaaaaa
1506 STATUS
1507 :TENTATIVE
1508 CLASS
1509 :PRIVATE
1510 X-MOZILLA-ALARM-DEFAULT-LENGTH
1512 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1514 RRULE
1515 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1516 DTSTART
1517 :20041112T140000
1518 DTEND
1519 :20041112T183000
1520 DTSTAMP
1521 :20041118T014117Z
1522 END:VEVENT
1523 BEGIN:VEVENT
1525 :87c928ee-3901-11d9-b21f-b45042155024
1526 SUMMARY
1527 :Rrrr/Cccccc ii Aaaaaaaa
1528 DESCRIPTION
1529 :Vvvvv Rrrr aaa Cccccc
1530 STATUS
1531 :TENTATIVE
1532 CLASS
1533 :PRIVATE
1534 X-MOZILLA-ALARM-DEFAULT-LENGTH
1536 DTSTART
1537 ;VALUE=DATE
1538 :20041119
1539 DTEND
1540 ;VALUE=DATE
1541 :20041120
1542 DTSTAMP
1543 :20041118T013107Z
1544 LAST-MODIFIED
1545 :20041118T014203Z
1546 END:VEVENT
1547 BEGIN:VEVENT
1549 :e8f331ae-3902-11d9-9948-dfdcb66a2872
1550 SUMMARY
1551 :Wwww aa hhhh
1552 STATUS
1553 :TENTATIVE
1554 CLASS
1555 :PRIVATE
1556 X-MOZILLA-ALARM-DEFAULT-LENGTH
1558 RRULE
1559 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1560 DTSTART
1561 ;VALUE=DATE
1562 :20041101
1563 DTEND
1564 ;VALUE=DATE
1565 :20041102
1566 DTSTAMP
1567 :20041118T014045Z
1568 LAST-MODIFIED
1569 :20041118T023846Z
1570 END:VEVENT
1571 END:VCALENDAR
1574 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1575 Status: TENTATIVE
1576 Class: PRIVATE
1577 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1578 Status: TENTATIVE
1579 Class: PRIVATE
1580 &23/11/2004 11:00-12:00 Hhhhhhhh
1581 Status: TENTATIVE
1582 Class: PRIVATE
1583 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1584 Status: TENTATIVE
1585 Class: PRIVATE
1586 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1587 Desc: Vvvvv Rrrr aaa Cccccc
1588 Status: TENTATIVE
1589 Class: PRIVATE
1590 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1591 Status: TENTATIVE
1592 Class: PRIVATE"
1593 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1594 Status: TENTATIVE
1595 Class: PRIVATE
1596 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1597 Status: TENTATIVE
1598 Class: PRIVATE
1599 &11/23/2004 11:00-12:00 Hhhhhhhh
1600 Status: TENTATIVE
1601 Class: PRIVATE
1602 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1603 Status: TENTATIVE
1604 Class: PRIVATE
1605 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1606 Desc: Vvvvv Rrrr aaa Cccccc
1607 Status: TENTATIVE
1608 Class: PRIVATE
1609 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1610 Status: TENTATIVE
1611 Class: PRIVATE")
1613 ;; 2004-09-09 pg
1614 (icalendar-testsuite--test-export
1615 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1618 "DTSTART;VALUE=DATE:20040101
1619 DTEND;VALUE=DATE:20040105
1620 SUMMARY:Urlaub")
1622 ;; 2004-10-25 pg
1623 (icalendar-testsuite--test-export
1625 "5 11 2004 Bla Fasel"
1627 "DTSTART;VALUE=DATE:20041105
1628 DTEND;VALUE=DATE:20041106
1629 SUMMARY:Bla Fasel")
1631 ;; 2004-10-30 pg
1632 (icalendar-testsuite--test-export
1634 "2 Nov 2004 15:00-16:30 Zahnarzt"
1636 "DTSTART;VALUE=DATE-TIME:20041102T150000
1637 DTEND;VALUE=DATE-TIME:20041102T163000
1638 SUMMARY:Zahnarzt")
1640 ;; 2005-02-07 lt
1641 (icalendar-testsuite--test-import
1642 "UID
1643 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1644 SUMMARY
1645 :Waitangi Day
1646 DESCRIPTION
1647 :abcdef
1648 CATEGORIES
1649 :Public Holiday
1650 STATUS
1651 :CONFIRMED
1652 CLASS
1653 :PRIVATE
1654 DTSTART
1655 ;VALUE=DATE
1656 :20050206
1657 DTEND
1658 ;VALUE=DATE
1659 :20050207
1660 DTSTAMP
1661 :20050128T011209Z"
1663 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1664 Desc: abcdef"
1665 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1666 Desc: abcdef")
1668 ;; 2005-03-01 lt
1669 (icalendar-testsuite--test-import
1670 "DTSTART;VALUE=DATE:20050217
1671 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1672 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1673 DTSTAMP:20050118T210335Z
1674 DURATION:P7D"
1676 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa"
1677 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa")
1679 ;; 2005-03-23 lt
1680 (icalendar-testsuite--test-export
1682 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1684 "DTSTART;VALUE=DATE-TIME:20050208T160000
1685 DTEND;VALUE=DATE-TIME:20050208T164500
1686 RRULE:FREQ=DAILY;INTERVAL=7
1687 SUMMARY:[WORK] Pppp
1690 ;; 2005-05-27 eu
1691 (icalendar-testsuite--test-export
1694 ;; FIXME: colon not allowed!
1695 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1696 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1697 "DTSTART;VALUE=DATE:19001101
1698 DTEND;VALUE=DATE:19001102
1699 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1700 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1704 (defun icalendar-testsuite--run-cycle-tests ()
1705 "Perform cycling tests."
1706 (icalendar-testsuite--test-cycle
1707 "DTSTART;VALUE=DATE-TIME:20030919T090000
1708 DTEND;VALUE=DATE-TIME:20030919T113000
1709 SUMMARY:Cycletest
1712 (icalendar-testsuite--test-cycle
1713 "DTSTART;VALUE=DATE-TIME:20030919T090000
1714 DTEND;VALUE=DATE-TIME:20030919T113000
1715 SUMMARY:Cycletest
1716 DESCRIPTION:beschreibung!
1717 LOCATION:nowhere
1718 ORGANIZER:ulf
1721 (icalendar-testsuite--test-cycle
1722 "DTSTART;VALUE=DATE:19190909
1723 DTEND;VALUE=DATE:19190910
1724 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1725 SUMMARY:and diary-anniversary
1730 (provide 'icalendar-testsuite)
1732 ;; arch-tag: 33a98396-90e9-49c8-b0e9-b606386d6e8c
1733 ;;; icalendar-testsuite.el ends here