(browse-url-text-xterm): Unquote browse-url-text-browser.
[emacs.git] / test / icalendar-testsuite.el
blob87233213a81029b3c5cabe5c67c52f708335b558
1 ;; icalendar-testsuite.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008 Free Software Foundation, Inc.
5 ;; Author: Ulf Jasper <ulf.jasper@web.de>
6 ;; Created: March 2005
7 ;; Keywords: calendar
8 ;; Human-Keywords: calendar, diary, iCalendar, vCalendar
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; 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; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
27 ;;; Commentary:
29 ;; TODO:
30 ;; - Add more unit tests for functions, timezone etc.
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))
53 (defun icalendar-testsuite--test-format-ical-event ()
54 "Test icalendar--format-ical-event"
55 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
56 (icalendar-import-format-summary "SUM %s")
57 (icalendar-import-format-location " LOC %s")
58 (icalendar-import-format-description " DES %s")
59 (icalendar-import-format-organizer " ORG %s")
60 (icalendar-import-format-status " STA %s")
61 (icalendar-import-format-url " URL %s")
62 (icalendar-import-format-class " CLA %s")
63 (was-european-calendar european-calendar-style)
64 (event (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
65 DTSTAMP:20030509T043439Z
66 DTSTART:20030509T103000
67 SUMMARY:sum
68 ORGANIZER:org
69 LOCATION:loc
70 DTEND:20030509T153000
71 DESCRIPTION:des
72 END:VEVENT
73 ")))
74 (assert (string= (icalendar--format-ical-event event)
75 "SUM sum DES des LOC loc ORG org") t)
76 (setq icalendar-import-format (lambda (&rest ignore)
77 "helloworld"))
78 (assert (string= (icalendar--format-ical-event event)
79 "helloworld") t)
80 (setq icalendar-import-format
81 (lambda (e)
82 (format "-%s-%s-%s-%s-%s-%s-%s-"
83 (icalendar--get-event-property event 'SUMMARY)
84 (icalendar--get-event-property event 'DESCRIPTION)
85 (icalendar--get-event-property event 'LOCATION)
86 (icalendar--get-event-property event 'ORGANIZER)
87 (icalendar--get-event-property event 'STATUS)
88 (icalendar--get-event-property event 'URL)
89 (icalendar--get-event-property event 'CLASS))))
90 (assert (string= (icalendar--format-ical-event event)
91 "-sum-des-loc-org-nil-nil-nil-") t)))
93 (defun icalendar-testsuite--test-parse-summary-and-rest ()
94 "Test icalendar--parse-summary-and-rest."
95 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
96 (icalendar-import-format-summary "SUM %s")
97 (icalendar-import-format-location " LOC %s")
98 (icalendar-import-format-description " DES %s")
99 (icalendar-import-format-organizer " ORG %s")
100 (icalendar-import-format-status " STA %s")
101 (icalendar-import-format-url " URL %s")
102 (icalendar-import-format-class " CLA %s")
103 (was-european-calendar european-calendar-style)
104 (result))
105 ;; FIXME: need a trailing blank char!
106 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org "))
107 (assert (string= (cdr (assoc 'org result)) "org"))
109 (setq result (icalendar--parse-summary-and-rest
110 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla "))
111 (assert (string= (cdr (assoc 'des result)) "des"))
112 (assert (string= (cdr (assoc 'loc result)) "loc"))
113 (assert (string= (cdr (assoc 'org result)) "org"))
114 (assert (string= (cdr (assoc 'sta result)) "sta"))
115 (assert (string= (cdr (assoc 'cla result)) "cla"))
117 (setq icalendar-import-format (lambda () "Hello world"))
118 (setq result (icalendar--parse-summary-and-rest
119 "blah blah "))
120 (assert (not result))
123 (defun icalendar-testsuite--get-ical-event (ical-string)
124 "Helper function for testing `icalendar-testsuite--test-format-ical-event'."
125 (save-excursion
126 (with-temp-buffer
127 (insert ical-string)
128 (goto-char (point-min))
129 (car (icalendar--read-element nil nil)))))
131 (defun icalendar-testsuite--test-import-format-sample ()
132 "Test method for `icalendar-import-format-sample'."
133 (assert (string= (icalendar-import-format-sample
134 (icalendar-testsuite--get-ical-event "BEGIN:VEVENT
135 DTSTAMP:20030509T043439Z
136 DTSTART:20030509T103000
137 SUMMARY:a
138 ORGANIZER:d
139 LOCATION:c
140 DTEND:20030509T153000
141 DESCRIPTION:b
142 END:VEVENT
144 (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' "
145 "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'"))))
147 (defun icalendar-testsuite--test-first-weekday-of-year ()
148 (assert (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
149 (assert (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
150 (assert (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
151 (assert (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
152 (assert (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
153 (assert (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
154 (assert (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
155 (assert (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
156 (assert (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
158 ;; ======================================================================
159 ;; Test methods for exporting from diary to icalendar
160 ;; ======================================================================
162 (defun icalendar-testsuite--test-export (input-european input-american
163 expected-output)
164 "Perform an export test.
165 Argument INPUT-EUROPEAN european style diary string.
166 Argument INPUT-AMERICAN american style diary string.
167 Argument EXPECTED-OUTPUT expected icalendar result string."
168 (message "--- icalendar-testsuite--test-export ---")
169 (let ((was-european-calendar european-calendar-style)
170 (icalendar-recurring-start-year 2000))
171 (set-time-zone-rule "CET") ;;FIXME: reset timezone!
172 (when input-european
173 (let ((calendar-month-name-array
174 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
175 "September" "Oktober" "November" "Dezember"])
176 (calendar-day-name-array
177 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
178 "Samstag"]))
179 (european-calendar)
180 (icalendar-testsuite--do-test-export input-european expected-output)))
181 (when input-american
182 (let ((calendar-month-name-array
183 ["January" "February" "March" "April" "May" "June" "July" "August"
184 "September" "October" "November" "December"])
185 (calendar-day-name-array
186 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
187 "Saturday"]))
188 (american-calendar)
189 (icalendar-testsuite--do-test-export input-american expected-output)))
190 (if was-european-calendar
191 (european-calendar)
192 (american-calendar))))
194 (defun icalendar-testsuite--do-test-export (input expected-output)
195 "Actually perform export test.
196 Argument INPUT input diary string.
197 Argument EXPECTED-OUTPUT expected icalendar result string."
198 (let ((temp-file (make-temp-file "icalendar-testsuite-ics")))
199 (with-temp-buffer
200 (insert input)
201 (icalendar-export-region (point-min) (point-max) temp-file))
202 (save-excursion
203 (find-file temp-file)
204 (goto-char (point-min))
205 (unless
206 (cond (expected-output
207 (and (re-search-forward "^\\s-*BEGIN:VCALENDAR
208 PRODID:-//Emacs//NONSGML icalendar.el//EN
209 VERSION:2.0
210 BEGIN:VEVENT
211 UID:emacs[0-9]+
212 \\(\\(.\\|\n\\)+\\)
213 END:VEVENT
214 END:VCALENDAR
215 \\s-*$"
216 nil t)
217 (string-match
218 (concat "^\\s-*"
219 (regexp-quote (buffer-substring-no-properties
220 (match-beginning 1) (match-end 1)))
221 "\\s-*$")
222 expected-output)))
224 (re-search-forward "^\\s-*BEGIN:VCALENDAR
225 PRODID:-//Emacs//NONSGML icalendar.el//EN
226 VERSION:2.0
227 END:VCALENDAR
228 \\s-*$"
229 nil t)))
230 (error
231 "Export test failed! Input: `%s'\nFound:\n\n%s\n\nbut expected\n\n%s"
232 input
233 (or (and (match-beginning 1)
234 (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
235 "<nil>")
236 (or expected-output "<nil>"))))
237 (kill-buffer (find-buffer-visiting temp-file))
238 (delete-file temp-file)))
240 ;; ======================================================================
241 ;; Test methods for importing from icalendar to diary
242 ;; ======================================================================
244 (defun icalendar-testsuite--test-import (input expected-european
245 expected-american)
246 "Perform import test.
247 Argument INPUT icalendar event string.
248 Argument EXPECTED-EUROPEAN expected european style diary string.
249 Argument EXPECTED-AMERICAN expected american style diary string."
250 (message "--- icalendar-testsuite--test-import ---")
251 (let ((timezone (cadr (current-time-zone))))
252 (set-time-zone-rule "CET")
253 (with-temp-buffer
254 (if (string-match "^BEGIN:VCALENDAR" input)
255 (insert input)
256 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
257 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
258 (insert input)
259 (unless (eq (char-before) ?\n)
260 (insert "\n"))
261 (insert "END:VEVENT\nEND:VCALENDAR\n"))
262 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
263 (icalendar-import-format-summary "%s")
264 (icalendar-import-format-location "\n Location: %s")
265 (icalendar-import-format-description "\n Desc: %s")
266 (icalendar-import-format-organizer "\n Organizer: %s")
267 (icalendar-import-format-status "\n Status: %s")
268 (icalendar-import-format-url "\n URL: %s")
269 (icalendar-import-format-class "\n Class: %s")
270 (was-european-calendar european-calendar-style))
271 (when expected-european
272 (european-calendar)
273 (icalendar-testsuite--do-test-import input expected-european))
274 (when expected-american
275 (american-calendar)
276 (icalendar-testsuite--do-test-import input expected-american))
277 (if was-european-calendar
278 (european-calendar)
279 (american-calendar))))
280 (set-time-zone-rule timezone)))
282 (defun icalendar-testsuite--do-test-import (input expected-output)
283 "Actually perform import test.
284 Argument INPUT input icalendar string.
285 Argument EXPECTED-OUTPUT expected diary string."
286 (let ((temp-file (make-temp-file "icalendar-test-diary")))
287 (icalendar-import-buffer temp-file t t)
288 (save-excursion
289 (find-file temp-file)
290 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
291 (unless (string-match (concat "^\\s-*" expected-output "\\s-*$")
292 result)
293 (error "Import test failed! Found `%s'\nbut expected `%s'" result
294 expected-output)))
295 (kill-buffer (find-buffer-visiting temp-file))
296 (delete-file temp-file))))
298 ;; ======================================================================
299 ;; Test methods for cycle...
300 ;; ======================================================================
301 (defun icalendar-testsuite--test-cycle (input)
302 "Perform cycle test.
303 Argument INPUT icalendar event string."
304 (with-temp-buffer
305 (if (string-match "^BEGIN:VCALENDAR" input)
306 (insert input)
307 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
308 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
309 (insert input)
310 (unless (eq (char-before) ?\n)
311 (insert "\n"))
312 (insert "END:VEVENT\nEND:VCALENDAR\n"))
313 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
314 (icalendar-import-format-summary "%s")
315 (icalendar-import-format-location "\n Location: %s")
316 (icalendar-import-format-description "\n Desc: %s")
317 (icalendar-import-format-organizer "\n Organizer: %s")
318 (icalendar-import-format-status "\n Status: %s")
319 (icalendar-import-format-url "\n URL: %s")
320 (icalendar-import-format-class "\n Class: %s")
321 (was-european-calendar european-calendar-style))
322 (european-calendar)
323 (icalendar-testsuite--do-test-cycle)
324 (american-calendar)
325 (icalendar-testsuite--do-test-cycle)
326 (if was-european-calendar
327 (european-calendar)
328 (american-calendar)))))
330 (defun icalendar-testsuite--do-test-cycle ()
331 "Actually perform import/export cycle test."
332 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
333 (temp-ics (make-temp-file "icalendar-test-ics"))
334 (org-input (buffer-substring-no-properties (point-min) (point-max))))
335 (icalendar-import-buffer temp-diary t t)
336 (save-excursion
337 (find-file temp-diary)
338 (icalendar-export-region (point-min) (point-max) temp-ics))
339 (save-excursion
340 (find-file temp-ics)
341 (goto-char (point-min))
342 (when (re-search-forward "\nUID:.*\n" nil t)
343 (replace-match "\n"))
344 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
345 (unless (string-equal org-input cycled)
346 (error "Import test failed! Found `%s'\nbut expected `%s'" cycled
347 org-input))))
348 (kill-buffer (find-buffer-visiting temp-diary))
349 (save-excursion
350 (set-buffer (find-buffer-visiting temp-ics))
351 (set-buffer-modified-p nil)
352 (kill-buffer (current-buffer)))
353 (delete-file temp-diary)
354 (delete-file temp-ics)))
356 ;; ======================================================================
357 ;; Import tests
358 ;; ======================================================================
359 (defun icalendar-testsuite--run-import-tests ()
360 "Perform standard import tests."
361 (icalendar-testsuite--test-import
362 "SUMMARY:non-recurring
363 DTSTART;VALUE=DATE-TIME:20030919T090000
364 DTEND;VALUE=DATE-TIME:20030919T113000"
365 "&19/9/2003 09:00-11:30 non-recurring"
366 "&9/19/2003 09:00-11:30 non-recurring")
368 (icalendar-testsuite--test-import
369 "SUMMARY:non-recurring allday
370 DTSTART;VALUE=DATE-TIME:20030919"
371 "&19/9/2003 non-recurring allday"
372 "&9/19/2003 non-recurring allday")
374 (icalendar-testsuite--test-import
375 "SUMMARY:long
376 summary
377 DTSTART;VALUE=DATE:20030919"
378 "&19/9/2003 long summary"
379 "&9/19/2003 long summary")
381 (icalendar-testsuite--test-import
382 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
383 SUMMARY:Sommerferien
384 STATUS:TENTATIVE
385 CLASS:PRIVATE
386 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
387 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
388 DTSTART;VALUE=DATE:20040719
389 DTEND;VALUE=DATE:20040828
390 DTSTAMP:20031103T011641Z
392 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien"
393 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien")
394 (icalendar-testsuite--test-import
395 "UID
396 :04979712-3902-11d9-93dd-8f9f4afe08da
397 SUMMARY
398 :folded summary
399 STATUS
400 :TENTATIVE
401 CLASS
402 :PRIVATE
403 X-MOZILLA-ALARM-DEFAULT-LENGTH
405 DTSTART
406 :20041123T140000
407 DTEND
408 :20041123T143000
409 DTSTAMP
410 :20041118T013430Z
411 LAST-MODIFIED
412 :20041118T013640Z
414 "&23/11/2004 14:00-14:30 folded summary"
415 "&11/23/2004 14:00-14:30 folded summary")
416 (icalendar-testsuite--test-import
417 "UID
418 :6161a312-3902-11d9-b512-f764153bb28b
419 SUMMARY
420 :another example
421 STATUS
422 :TENTATIVE
423 CLASS
424 :PRIVATE
425 X-MOZILLA-ALARM-DEFAULT-LENGTH
427 DTSTART
428 :20041123T144500
429 DTEND
430 :20041123T154500
431 DTSTAMP
432 :20041118T013641Z
434 "&23/11/2004 14:45-15:45 another example"
435 "&11/23/2004 14:45-15:45 another example")
436 (icalendar-testsuite--test-import
437 "SUMMARY:rrule daily
438 DTSTART;VALUE=DATE-TIME:20030919T090000
439 DTEND;VALUE=DATE-TIME:20030919T113000
440 RRULE:FREQ=DAILY;
442 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily"
443 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily")
445 ;; RRULE examples
446 (icalendar-testsuite--test-import
447 "SUMMARY:rrule daily
448 DTSTART;VALUE=DATE-TIME:20030919T090000
449 DTEND;VALUE=DATE-TIME:20030919T113000
450 RRULE:FREQ=DAILY;INTERVAL=2
452 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily"
453 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily")
454 (icalendar-testsuite--test-import
455 "SUMMARY:rrule daily with exceptions
456 DTSTART;VALUE=DATE-TIME:20030919T090000
457 DTEND;VALUE=DATE-TIME:20030919T113000
458 RRULE:FREQ=DAILY;INTERVAL=2
459 EXDATE:20030921,20030925
461 "&%%(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"
462 "&%%(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")
463 (icalendar-testsuite--test-import
464 "SUMMARY:rrule weekly
465 DTSTART;VALUE=DATE-TIME:20030919T090000
466 DTEND;VALUE=DATE-TIME:20030919T113000
467 RRULE:FREQ=WEEKLY;
469 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly"
470 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly")
471 (icalendar-testsuite--test-import
472 "SUMMARY:rrule monthly no end
473 DTSTART;VALUE=DATE-TIME:20030919T090000
474 DTEND;VALUE=DATE-TIME:20030919T113000
475 RRULE:FREQ=MONTHLY;
477 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end"
478 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end")
479 (icalendar-testsuite--test-import
480 "SUMMARY:rrule monthly with end
481 DTSTART;VALUE=DATE-TIME:20030919T090000
482 DTEND;VALUE=DATE-TIME:20030919T113000
483 RRULE:FREQ=MONTHLY;UNTIL=20050819;
485 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end"
486 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end")
487 (icalendar-testsuite--test-import
488 "DTSTART;VALUE=DATE:20040815
489 DTEND;VALUE=DATE:20040816
490 SUMMARY:Maria Himmelfahrt
491 UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
492 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
494 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt"
495 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt")
496 (icalendar-testsuite--test-import
497 "SUMMARY:rrule yearly
498 DTSTART;VALUE=DATE-TIME:20030919T090000
499 DTEND;VALUE=DATE-TIME:20030919T113000
500 RRULE:FREQ=YEARLY;INTERVAL=2
502 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME
503 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME
504 (icalendar-testsuite--test-import
505 "SUMMARY:rrule count daily short
506 DTSTART;VALUE=DATE-TIME:20030919T090000
507 DTEND;VALUE=DATE-TIME:20030919T113000
508 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
510 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short"
511 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short")
512 (icalendar-testsuite--test-import
513 "SUMMARY:rrule count daily long
514 DTSTART;VALUE=DATE-TIME:20030919T090000
515 DTEND;VALUE=DATE-TIME:20030919T113000
516 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
518 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long"
519 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long")
520 (icalendar-testsuite--test-import
521 "SUMMARY:rrule count bi-weekly 3 times
522 DTSTART;VALUE=DATE-TIME:20030919T090000
523 DTEND;VALUE=DATE-TIME:20030919T113000
524 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
526 "&%%(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"
527 "&%%(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")
528 (icalendar-testsuite--test-import
529 "SUMMARY:rrule count monthly
530 DTSTART;VALUE=DATE-TIME:20030919T090000
531 DTEND;VALUE=DATE-TIME:20030919T113000
532 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
534 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly"
535 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly")
536 (icalendar-testsuite--test-import
537 "SUMMARY:rrule count every second month
538 DTSTART;VALUE=DATE-TIME:20030919T090000
539 DTEND;VALUE=DATE-TIME:20030919T113000
540 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
542 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME
543 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME
544 (icalendar-testsuite--test-import
545 "SUMMARY:rrule count yearly
546 DTSTART;VALUE=DATE-TIME:20030919T090000
547 DTEND;VALUE=DATE-TIME:20030919T113000
548 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
550 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly"
551 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly")
552 (icalendar-testsuite--test-import
553 "SUMMARY:rrule count every second year
554 DTSTART;VALUE=DATE-TIME:20030919T090000
555 DTEND;VALUE=DATE-TIME:20030919T113000
556 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
558 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!!
559 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!!
561 ;; duration
562 (icalendar-testsuite--test-import
563 "DTSTART;VALUE=DATE:20050217
564 SUMMARY:duration
565 DURATION:P7D
567 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration"
568 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration")
570 (icalendar-testsuite--test-import
571 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
572 DTSTAMP:20041127T183315Z
573 LAST-MODIFIED:20041127T183329
574 SUMMARY:Urlaub
575 DTSTART;VALUE=DATE:20011221
576 DTEND;VALUE=DATE:20011221
577 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
578 CLASS:PUBLIC
579 SEQUENCE:1
580 CREATED:20041127T183329
582 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub"
583 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub")
586 ;; ======================================================================
587 ;; Export tests
588 ;; ======================================================================
589 (defun icalendar-testsuite--run-export-tests ()
590 "Perform standard export tests."
592 (let ((icalendar-export-hidden-diary-entries nil))
593 (icalendar-testsuite--test-export
594 "&3 Okt 2000 ordinary no time "
595 "&Oct 3 2000 ordinary no time "
596 nil))
598 ;; "ordinary" events
599 (icalendar-testsuite--test-export
600 "3 Okt 2000 ordinary no time "
601 "Oct 3 2000 ordinary no time "
602 "DTSTART;VALUE=DATE:20001003
603 DTEND;VALUE=DATE:20001004
604 SUMMARY:ordinary no time
606 (icalendar-testsuite--test-export
607 "3 Okt 2000 16:30 ordinary with time"
608 "Oct 3 2000 16:30 ordinary with time"
609 "DTSTART;VALUE=DATE-TIME:20001003T163000
610 DTEND;VALUE=DATE-TIME:20001003T173000
611 SUMMARY:ordinary with time
613 (icalendar-testsuite--test-export
614 "3 10 2000 16:30 ordinary with time 2"
615 "10 3 2000 16:30 ordinary with time 2"
616 "DTSTART;VALUE=DATE-TIME:20001003T163000
617 DTEND;VALUE=DATE-TIME:20001003T173000
618 SUMMARY:ordinary with time 2
621 (icalendar-testsuite--test-export
622 "3/10/2000 16:30 ordinary with time 3"
623 "10/3/2000 16:30 ordinary with time 3"
624 "DTSTART;VALUE=DATE-TIME:20001003T163000
625 DTEND;VALUE=DATE-TIME:20001003T173000
626 SUMMARY:ordinary with time 3
629 ;; multiline -- FIXME!!!
630 (icalendar-testsuite--test-export
631 "3 Oktober 2000 16:30 multiline
632 17:30 multiline continued FIXME"
633 "October 3 2000 16:30 multiline
634 17:30 multiline continued FIXME"
635 "DTSTART;VALUE=DATE-TIME:20001003T163000
636 DTEND;VALUE=DATE-TIME:20001003T173000
637 SUMMARY:multiline
638 DESCRIPTION:
639 17:30 multiline continued FIXME
642 ;; weekly by day
643 (icalendar-testsuite--test-export
644 "Montag 13:30 weekly by day with start time"
645 "Monday 1:30pm weekly by day with start time"
646 "DTSTART;VALUE=DATE-TIME:20000103T133000
647 DTEND;VALUE=DATE-TIME:20000103T143000
648 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
649 SUMMARY:weekly by day with start time
652 (icalendar-testsuite--test-export
653 "Montag 13:30-15:00 weekly by day with start and end time"
654 "Monday 01:30pm-03:00pm weekly by day with start and end time"
655 "DTSTART;VALUE=DATE-TIME:20000103T133000
656 DTEND;VALUE=DATE-TIME:20000103T150000
657 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
658 SUMMARY:weekly by day with start and end time
661 ;; yearly
662 (icalendar-testsuite--test-export
663 "1 Mai yearly no time"
664 "may 1 yearly no time"
665 "DTSTART;VALUE=DATE:19000501
666 DTEND;VALUE=DATE:19000502
667 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
668 SUMMARY:yearly no time
671 ;; anniversaries
672 (icalendar-testsuite--test-export
673 "%%(diary-anniversary 3 10 1989) anniversary no time"
674 "%%(diary-anniversary 10 3 1989) anniversary no time"
675 "DTSTART;VALUE=DATE:19891003
676 DTEND;VALUE=DATE:19891004
677 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
678 SUMMARY:anniversary no time
680 (icalendar-testsuite--test-export
681 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
682 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
683 "DTSTART;VALUE=DATE-TIME:19891003T190000
684 DTEND;VALUE=DATE-TIME:19891004T200000
685 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
686 SUMMARY:anniversary with time
689 ;; block
690 (icalendar-testsuite--test-export
691 "%%(diary-block 18 6 2001 6 7 2001) block no time"
692 "%%(diary-block 6 18 2001 7 6 2001) block no time"
693 "DTSTART;VALUE=DATE:20010618
694 DTEND;VALUE=DATE:20010707
695 SUMMARY:block no time
697 (icalendar-testsuite--test-export
698 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
699 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
700 "DTSTART;VALUE=DATE-TIME:20010618T130000
701 DTEND;VALUE=DATE-TIME:20010618T170000
702 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
703 SUMMARY:block with time
705 (icalendar-testsuite--test-export
706 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
707 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
708 "DTSTART;VALUE=DATE-TIME:20010618T130000
709 DTEND;VALUE=DATE-TIME:20010618T140000
710 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
711 SUMMARY:block no end time
715 ;; ======================================================================
716 ;; Real world
717 ;; ======================================================================
718 (defun icalendar-testsuite--run-real-world-tests ()
719 "Perform real-world tests, as gathered from problem reports."
720 ;; 2003-05-29
721 (icalendar-testsuite--test-import
722 "BEGIN:VCALENDAR
723 METHOD:REQUEST
724 PRODID:Microsoft CDO for Microsoft Exchange
725 VERSION:2.0
726 BEGIN:VTIMEZONE
727 TZID:Kolkata\, Chennai\, Mumbai\, New Delhi
728 X-MICROSOFT-CDO-TZID:23
729 BEGIN:STANDARD
730 DTSTART:16010101T000000
731 TZOFFSETFROM:+0530
732 TZOFFSETTO:+0530
733 END:STANDARD
734 BEGIN:DAYLIGHT
735 DTSTART:16010101T000000
736 TZOFFSETFROM:+0530
737 TZOFFSETTO:+0530
738 END:DAYLIGHT
739 END:VTIMEZONE
740 BEGIN:VEVENT
741 DTSTAMP:20030509T043439Z
742 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
743 SUMMARY:On-Site Interview
744 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
745 010000000DB823520692542408ED02D7023F9DFF9
746 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
747 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
748 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
749 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
750 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
751 zz\":MAILTO:zzzzzz@zzzzzzz.com
752 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
753 LOCATION:Cccc
754 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
755 DESCRIPTION:10:30am - Blah
756 SEQUENCE:0
757 PRIORITY:5
758 CLASS:
759 CREATED:20030509T043439Z
760 LAST-MODIFIED:20030509T043459Z
761 STATUS:CONFIRMED
762 TRANSP:OPAQUE
763 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
764 X-MICROSOFT-CDO-INSTTYPE:0
765 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
766 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
767 X-MICROSOFT-CDO-IMPORTANCE:1
768 X-MICROSOFT-CDO-OWNERAPPTID:126441427
769 BEGIN:VALARM
770 ACTION:DISPLAY
771 DESCRIPTION:REMINDER
772 TRIGGER;RELATED=START:-PT00H15M00S
773 END:VALARM
774 END:VEVENT
775 END:VCALENDAR"
776 "&9/5/2003 10:30-15:30 On-Site Interview
777 Desc: 10:30am - Blah
778 Location: Cccc
779 Organizer: MAILTO:aaaaaaa@aaaaaaa.com"
780 "&5/9/2003 10:30-15:30 On-Site Interview
781 Desc: 10:30am - Blah
782 Location: Cccc
783 Organizer: MAILTO:aaaaaaa@aaaaaaa.com")
785 ;; 2003-06-18 a
786 (icalendar-testsuite--test-import
787 "DTSTAMP:20030618T195512Z
788 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
789 SUMMARY:Dress Rehearsal for XXXX-XXXX
790 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
791 0100000007C3A6D65EE726E40B7F3D69A23BD567E
792 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
793 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
794 ORGANIZER;CN=\"ABCD,TECHTRAINING
795 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
796 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
797 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
798 DESCRIPTION:753 Zeichen hier radiert
799 SEQUENCE:0
800 PRIORITY:5
801 CLASS:
802 CREATED:20030618T195518Z
803 LAST-MODIFIED:20030618T195527Z
804 STATUS:CONFIRMED
805 TRANSP:OPAQUE
806 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
807 X-MICROSOFT-CDO-INSTTYPE:0
808 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
809 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
810 X-MICROSOFT-CDO-IMPORTANCE:1
811 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
812 BEGIN:VALARM
813 ACTION:DISPLAY
814 DESCRIPTION:REMINDER
815 TRIGGER;RELATED=START:-PT00H15M00S
816 END:VALARM"
817 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
818 Desc: 753 Zeichen hier radiert
819 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
820 Organizer: MAILTO:xxx@xxxxx.com"
821 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
822 Desc: 753 Zeichen hier radiert
823 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
824 Organizer: MAILTO:xxx@xxxxx.com")
826 ;; 2003-06-18 b -- uses timezone
827 (icalendar-testsuite--test-import
828 "BEGIN:VCALENDAR
829 METHOD:REQUEST
830 PRODID:Microsoft CDO for Microsoft Exchange
831 VERSION:2.0
832 BEGIN:VTIMEZONE
833 TZID:Mountain Time (US & Canada)
834 X-MICROSOFT-CDO-TZID:12
835 BEGIN:STANDARD
836 DTSTART:16010101T020000
837 TZOFFSETFROM:-0600
838 TZOFFSETTO:-0700
839 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
840 END:STANDARD
841 BEGIN:DAYLIGHT
842 DTSTART:16010101T020000
843 TZOFFSETFROM:-0700
844 TZOFFSETTO:-0600
845 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
846 END:DAYLIGHT
847 END:VTIMEZONE
848 BEGIN:VEVENT
849 DTSTAMP:20030618T230323Z
850 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
851 SUMMARY:Updated: Dress Rehearsal for ABC01-15
852 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
853 0100000007C3A6D65EE726E40B7F3D69A23BD567E
854 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
855 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
856 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
857 .com
858 ORGANIZER;CN=\"ABCD,TECHTRAINING
859 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
860 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
861 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
862 DESCRIPTION:Viele Zeichen standen hier früher
863 SEQUENCE:0
864 PRIORITY:5
865 CLASS:
866 CREATED:20030618T230326Z
867 LAST-MODIFIED:20030618T230335Z
868 STATUS:CONFIRMED
869 TRANSP:OPAQUE
870 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
871 X-MICROSOFT-CDO-INSTTYPE:0
872 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
873 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
874 X-MICROSOFT-CDO-IMPORTANCE:1
875 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
876 BEGIN:VALARM
877 ACTION:DISPLAY
878 DESCRIPTION:REMINDER
879 TRIGGER;RELATED=START:-PT00H15M00S
880 END:VALARM
881 END:VEVENT
882 END:VCALENDAR"
883 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
884 Desc: Viele Zeichen standen hier früher
885 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
886 Organizer: MAILTO:bbb@bbbbb.com
887 Status: CONFIRMED"
888 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
889 Desc: Viele Zeichen standen hier früher
890 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
891 Organizer: MAILTO:bbb@bbbbb.com
892 Status: CONFIRMED")
894 ;; export 2004-10-28 block entries
895 (icalendar-testsuite--test-export
897 "-*- mode: text; fill-column: 256;-*-
899 >>> block entries:
901 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
903 "DTSTART;VALUE=DATE:20041108
904 DTEND;VALUE=DATE:20041111
905 SUMMARY:Nov 8-10 aa")
907 (icalendar-testsuite--test-export
909 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
910 "DTSTART;VALUE=DATE:20041213
911 DTEND;VALUE=DATE:20041218
912 SUMMARY:Dec 13-17 bb")
914 (icalendar-testsuite--test-export
916 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
917 "DTSTART;VALUE=DATE:20050203
918 DTEND;VALUE=DATE:20050205
919 SUMMARY:Feb 3-4 cc")
921 (icalendar-testsuite--test-export
923 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
924 "DTSTART;VALUE=DATE:20050424
925 DTEND;VALUE=DATE:20050430
926 SUMMARY:April 24-29 dd
928 (icalendar-testsuite--test-export
930 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
931 "DTSTART;VALUE=DATE:20050530
932 DTEND;VALUE=DATE:20050602
933 SUMMARY:may 30 - June 1: ee")
935 (icalendar-testsuite--test-export
937 "%%(diary-block 6 6 2005 6 8 2005) ff"
938 "DTSTART;VALUE=DATE:20050606
939 DTEND;VALUE=DATE:20050609
940 SUMMARY:ff")
942 ;; export 2004-10-28 anniversary entries
943 (icalendar-testsuite--test-export
946 >>> anniversaries:
948 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
949 "DTSTART;VALUE=DATE:19910328
950 DTEND;VALUE=DATE:19910329
951 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
952 SUMMARY:aa birthday (%d years old)
955 (icalendar-testsuite--test-export
957 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
958 "DTSTART;VALUE=DATE:19570517
959 DTEND;VALUE=DATE:19570518
960 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
961 SUMMARY:bb birthday (%d years old)")
963 (icalendar-testsuite--test-export
965 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
966 "DTSTART;VALUE=DATE:19970608
967 DTEND;VALUE=DATE:19970609
968 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
969 SUMMARY:cc birthday (%d years old)")
971 (icalendar-testsuite--test-export
973 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
974 "DTSTART;VALUE=DATE:19830722
975 DTEND;VALUE=DATE:19830723
976 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
977 SUMMARY:dd (%d years ago...!)")
979 (icalendar-testsuite--test-export
981 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
982 "DTSTART;VALUE=DATE:19880801
983 DTEND;VALUE=DATE:19880802
984 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
985 SUMMARY:ee birthday (%d years old)")
987 (icalendar-testsuite--test-export
989 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
990 "DTSTART;VALUE=DATE:19570921
991 DTEND;VALUE=DATE:19570922
992 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
993 SUMMARY:ff birthday (%d years old)")
996 ;; FIXME!
998 ;; export 2004-10-28 monthly, weekly entries
1000 ;; (icalendar-testsuite--test-export
1001 ;; nil
1002 ;; "
1003 ;; >>> ------------ monthly:
1005 ;; */27/* 10:00 blah blah"
1006 ;; "xxx")
1008 (icalendar-testsuite--test-export
1010 ">>> ------------ my week:
1012 Monday 13:00 MAC"
1013 "DTSTART;VALUE=DATE-TIME:20000103T130000
1014 DTEND;VALUE=DATE-TIME:20000103T140000
1015 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1016 SUMMARY:MAC")
1018 (icalendar-testsuite--test-export
1020 "Monday 15:00 a1"
1021 "DTSTART;VALUE=DATE-TIME:20000103T150000
1022 DTEND;VALUE=DATE-TIME:20000103T160000
1023 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1024 SUMMARY:a1")
1027 (icalendar-testsuite--test-export
1029 "Monday 16:00-17:00 a2"
1030 "DTSTART;VALUE=DATE-TIME:20000103T160000
1031 DTEND;VALUE=DATE-TIME:20000103T170000
1032 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1033 SUMMARY:a2")
1035 (icalendar-testsuite--test-export
1037 "Tuesday 11:30-13:00 a3"
1038 "DTSTART;VALUE=DATE-TIME:20000104T113000
1039 DTEND;VALUE=DATE-TIME:20000104T130000
1040 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1041 SUMMARY:a3")
1043 (icalendar-testsuite--test-export
1045 "Tuesday 15:00 a4"
1046 "DTSTART;VALUE=DATE-TIME:20000104T150000
1047 DTEND;VALUE=DATE-TIME:20000104T160000
1048 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1049 SUMMARY:a4")
1051 (icalendar-testsuite--test-export
1053 "Wednesday 13:00 a5"
1054 "DTSTART;VALUE=DATE-TIME:20000105T130000
1055 DTEND;VALUE=DATE-TIME:20000105T140000
1056 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1057 SUMMARY:a5")
1059 (icalendar-testsuite--test-export
1061 "Wednesday 11:30-13:30 a6"
1062 "DTSTART;VALUE=DATE-TIME:20000105T113000
1063 DTEND;VALUE=DATE-TIME:20000105T133000
1064 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1065 SUMMARY:a6")
1067 (icalendar-testsuite--test-export
1069 "Wednesday 15:00 s1"
1070 "DTSTART;VALUE=DATE-TIME:20000105T150000
1071 DTEND;VALUE=DATE-TIME:20000105T160000
1072 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1073 SUMMARY:s1")
1076 ;; export 2004-10-28 regular entries
1077 (icalendar-testsuite--test-export
1080 >>> regular diary entries:
1082 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1083 "DTSTART;VALUE=DATE-TIME:20041012T140000
1084 DTEND;VALUE=DATE-TIME:20041012T150000
1085 SUMMARY:Tue: [2004-10-12] q1")
1087 ;; 2004-11-19
1088 (icalendar-testsuite--test-import
1089 "BEGIN:VCALENDAR
1090 VERSION
1091 :2.0
1092 PRODID
1093 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1094 BEGIN:VEVENT
1096 :04979712-3902-11d9-93dd-8f9f4afe08da
1097 SUMMARY
1098 :Jjjjj & Wwwww
1099 STATUS
1100 :TENTATIVE
1101 CLASS
1102 :PRIVATE
1103 X-MOZILLA-ALARM-DEFAULT-LENGTH
1105 DTSTART
1106 :20041123T140000
1107 DTEND
1108 :20041123T143000
1109 DTSTAMP
1110 :20041118T013430Z
1111 LAST-MODIFIED
1112 :20041118T013640Z
1113 END:VEVENT
1114 BEGIN:VEVENT
1116 :6161a312-3902-11d9-b512-f764153bb28b
1117 SUMMARY
1118 :BB Aaaaaaaa Bbbbb
1119 STATUS
1120 :TENTATIVE
1121 CLASS
1122 :PRIVATE
1123 X-MOZILLA-ALARM-DEFAULT-LENGTH
1125 DTSTART
1126 :20041123T144500
1127 DTEND
1128 :20041123T154500
1129 DTSTAMP
1130 :20041118T013641Z
1131 END:VEVENT
1132 BEGIN:VEVENT
1134 :943a4d7e-3902-11d9-9ce7-c9addeadf928
1135 SUMMARY
1136 :Hhhhhhhh
1137 STATUS
1138 :TENTATIVE
1139 CLASS
1140 :PRIVATE
1141 X-MOZILLA-ALARM-DEFAULT-LENGTH
1143 DTSTART
1144 :20041123T110000
1145 DTEND
1146 :20041123T120000
1147 DTSTAMP
1148 :20041118T013831Z
1149 END:VEVENT
1150 BEGIN:VEVENT
1152 :fe53615e-3902-11d9-9dd8-9d38a155bf41
1153 SUMMARY
1154 :MMM Aaaaaaaaa
1155 STATUS
1156 :TENTATIVE
1157 CLASS
1158 :PRIVATE
1159 X-MOZILLA-ALARM-DEFAULT-LENGTH
1161 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1163 RRULE
1164 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1165 DTSTART
1166 :20041112T140000
1167 DTEND
1168 :20041112T183000
1169 DTSTAMP
1170 :20041118T014117Z
1171 END:VEVENT
1172 BEGIN:VEVENT
1174 :87c928ee-3901-11d9-b21f-b45042155024
1175 SUMMARY
1176 :Rrrr/Cccccc ii Aaaaaaaa
1177 DESCRIPTION
1178 :Vvvvv Rrrr aaa Cccccc
1179 STATUS
1180 :TENTATIVE
1181 CLASS
1182 :PRIVATE
1183 X-MOZILLA-ALARM-DEFAULT-LENGTH
1185 DTSTART
1186 ;VALUE=DATE
1187 :20041119
1188 DTEND
1189 ;VALUE=DATE
1190 :20041120
1191 DTSTAMP
1192 :20041118T013107Z
1193 LAST-MODIFIED
1194 :20041118T014203Z
1195 END:VEVENT
1196 BEGIN:VEVENT
1198 :e8f331ae-3902-11d9-9948-dfdcb66a2872
1199 SUMMARY
1200 :Wwww aa hhhh
1201 STATUS
1202 :TENTATIVE
1203 CLASS
1204 :PRIVATE
1205 X-MOZILLA-ALARM-DEFAULT-LENGTH
1207 RRULE
1208 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1209 DTSTART
1210 ;VALUE=DATE
1211 :20041101
1212 DTEND
1213 ;VALUE=DATE
1214 :20041102
1215 DTSTAMP
1216 :20041118T014045Z
1217 LAST-MODIFIED
1218 :20041118T023846Z
1219 END:VEVENT
1220 END:VCALENDAR
1222 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
1223 Status: TENTATIVE
1224 Class: PRIVATE
1225 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1226 Status: TENTATIVE
1227 Class: PRIVATE
1228 &23/11/2004 11:00-12:00 Hhhhhhhh
1229 Status: TENTATIVE
1230 Class: PRIVATE
1231 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
1232 Status: TENTATIVE
1233 Class: PRIVATE
1234 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
1235 Desc: Vvvvv Rrrr aaa Cccccc
1236 Status: TENTATIVE
1237 Class: PRIVATE
1238 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
1239 Status: TENTATIVE
1240 Class: PRIVATE "
1241 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
1242 Status: TENTATIVE
1243 Class: PRIVATE
1244 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
1245 Status: TENTATIVE
1246 Class: PRIVATE
1247 &11/23/2004 11:00-12:00 Hhhhhhhh
1248 Status: TENTATIVE
1249 Class: PRIVATE
1250 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
1251 Status: TENTATIVE
1252 Class: PRIVATE
1253 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
1254 Desc: Vvvvv Rrrr aaa Cccccc
1255 Status: TENTATIVE
1256 Class: PRIVATE
1257 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
1258 Status: TENTATIVE
1259 Class: PRIVATE ")
1261 ;; 2004-09-09 pg
1262 (icalendar-testsuite--test-export
1263 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
1265 "DTSTART;VALUE=DATE:20040101
1266 DTEND;VALUE=DATE:20040105
1267 SUMMARY:Urlaub")
1269 ;; 2004-10-25 pg
1270 (icalendar-testsuite--test-export
1271 "5 11 2004 Bla Fasel"
1273 "DTSTART;VALUE=DATE:20041105
1274 DTEND;VALUE=DATE:20041106
1275 SUMMARY:Bla Fasel")
1277 ;; 2004-10-30 pg
1278 (icalendar-testsuite--test-export
1279 "2 Nov 2004 15:00-16:30 Zahnarzt"
1281 "DTSTART;VALUE=DATE-TIME:20041102T150000
1282 DTEND;VALUE=DATE-TIME:20041102T163000
1283 SUMMARY:Zahnarzt")
1285 ;; 2005-02-07 lt
1286 (icalendar-testsuite--test-import
1287 "UID
1288 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
1289 SUMMARY
1290 :Waitangi Day
1291 DESCRIPTION
1292 :abcdef
1293 CATEGORIES
1294 :Public Holiday
1295 STATUS
1296 :CONFIRMED
1297 CLASS
1298 :PRIVATE
1299 DTSTART
1300 ;VALUE=DATE
1301 :20050206
1302 DTEND
1303 ;VALUE=DATE
1304 :20050207
1305 DTSTAMP
1306 :20050128T011209Z"
1307 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
1308 Desc: abcdef"
1309 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
1310 Desc: abcdef")
1312 ;; 2005-03-01 lt
1313 (icalendar-testsuite--test-import
1314 "DTSTART;VALUE=DATE:20050217
1315 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
1316 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
1317 DTSTAMP:20050118T210335Z
1318 DURATION:P7D"
1319 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa"
1320 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa")
1322 ;; 2005-03-23 lt
1323 (icalendar-testsuite--test-export
1324 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
1326 "DTSTART;VALUE=DATE-TIME:20050208T160000
1327 DTEND;VALUE=DATE-TIME:20050208T164500
1328 RRULE:FREQ=DAILY;INTERVAL=7
1329 SUMMARY:[WORK] Pppp
1332 ;; 2005-05-27 eu
1333 (icalendar-testsuite--test-export
1335 ;; FIXME: colon not allowed!
1336 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1337 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
1338 "DTSTART;VALUE=DATE:19001101
1339 DTEND;VALUE=DATE:19001102
1340 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
1341 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
1345 (defun icalendar-testsuite--run-cycle-tests ()
1346 (icalendar-testsuite--test-cycle
1347 "DTSTART;VALUE=DATE-TIME:20030919T090000
1348 DTEND;VALUE=DATE-TIME:20030919T113000
1349 SUMMARY:Cycletest
1352 (icalendar-testsuite--test-cycle
1353 "DTSTART;VALUE=DATE-TIME:20030919T090000
1354 DTEND;VALUE=DATE-TIME:20030919T113000
1355 SUMMARY:Cycletest
1356 DESCRIPTION:beschreibung!
1357 LOCATION:nowhere
1358 ORGANIZER:ulf
1361 ;; FIXME: does not work
1362 ;; (icalendar-testsuite--test-cycle
1363 ;; "DTSTART;VALUE=DATE:19190909
1364 ;;DTEND;VALUE=DATE:19190910
1365 ;;RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1366 ;;SUMMARY:and diary-anniversary
1367 ;;")
1371 (provide 'icalendar-testsuite)
1373 ;; arch-tag: 33a98396-90e9-49c8-b0e9-b606386d6e8c
1374 ;;; icalendar-testsuite.el ends here