Do not use map.el in seq-tests.el
[emacs.git] / test / lisp / calendar / icalendar-tests.el
blob6db4222697e077f798c52269ff45198b9542b5df
1 ;; icalendar-tests.el --- Test suite for icalendar.el
3 ;; Copyright (C) 2005, 2008-2016 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:
34 (require 'ert)
35 (require 'icalendar)
37 ;; ======================================================================
38 ;; Helpers
39 ;; ======================================================================
41 (defun icalendar-tests--get-ical-event (ical-string)
42 "Return iCalendar event for ICAL-STRING."
43 (save-excursion
44 (with-temp-buffer
45 (insert ical-string)
46 (goto-char (point-min))
47 (car (icalendar--read-element nil nil)))))
49 (defun icalendar-tests--trim (string)
50 "Remove leading and trailing whitespace from STRING."
51 (replace-regexp-in-string "[ \t\n]+\\'" ""
52 (replace-regexp-in-string "\\`[ \t\n]+" "" string)))
54 ;; ======================================================================
55 ;; Tests of functions
56 ;; ======================================================================
58 (ert-deftest icalendar--create-uid ()
59 "Test for `icalendar--create-uid'."
60 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
61 (icalendar--uid-count 77)
62 (entry-full "30.06.1964 07:01 blahblah")
63 (hash (format "%d" (abs (sxhash entry-full))))
64 (contents "DTSTART:19640630T070100\nblahblah")
65 (username (or user-login-name "UNKNOWN_USER")))
66 (cl-letf (((symbol-function 'current-time) (lambda () '(1 2 3))))
67 (should (= 77 icalendar--uid-count))
68 (should (string= (concat "xxx-123-77-" hash "-" username "-19640630")
69 (icalendar--create-uid entry-full contents)))
70 (should (= 78 icalendar--uid-count)))
71 (setq contents "blahblah")
72 (setq icalendar-uid-format "yyy%syyy")
73 (should (string= (concat "yyyDTSTARTyyy")
74 (icalendar--create-uid entry-full contents)))))
76 (ert-deftest icalendar-convert-anniversary-to-ical ()
77 "Test method for `icalendar--convert-anniversary-to-ical'."
78 (let* ((calendar-date-style 'iso)
79 result)
80 (setq result (icalendar--convert-anniversary-to-ical
81 "" "%%(diary-anniversary 1964 6 30) g"))
82 (should (consp result))
83 (should (string= (concat
84 "\nDTSTART;VALUE=DATE:19640630"
85 "\nDTEND;VALUE=DATE:19640701"
86 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=30")
87 (car result)))
88 (should (string= "g" (cdr result)))))
90 (ert-deftest icalendar--convert-cyclic-to-ical ()
91 "Test method for `icalendar--convert-cyclic-to-ical'."
92 (let* ((calendar-date-style 'iso)
93 result)
94 (setq result (icalendar--convert-block-to-ical
95 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
96 (should (consp result))
97 (should (string= (concat
98 "\nDTSTART;VALUE=DATE:20040719"
99 "\nDTEND;VALUE=DATE:20040828")
100 (car result)))
101 (should (string= "Sommerferien" (cdr result)))))
103 (ert-deftest icalendar--convert-block-to-ical ()
104 "Test method for `icalendar--convert-block-to-ical'."
105 (let* ((calendar-date-style 'iso)
106 result)
107 (setq result (icalendar--convert-block-to-ical
108 "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien"))
109 (should (consp result))
110 (should (string= (concat
111 "\nDTSTART;VALUE=DATE:20040719"
112 "\nDTEND;VALUE=DATE:20040828")
113 (car result)))
114 (should (string= "Sommerferien" (cdr result)))))
116 (ert-deftest icalendar--convert-yearly-to-ical ()
117 "Test method for `icalendar--convert-yearly-to-ical'."
118 (let* ((calendar-date-style 'iso)
119 result
120 (calendar-month-name-array
121 ["January" "February" "March" "April" "May" "June" "July" "August"
122 "September" "October" "November" "December"]))
123 (setq result (icalendar--convert-yearly-to-ical "" "May 1 Tag der Arbeit"))
124 (should (consp result))
125 (should (string= (concat
126 "\nDTSTART;VALUE=DATE:19000501"
127 "\nDTEND;VALUE=DATE:19000502"
128 "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1")
129 (car result)))
130 (should (string= "Tag der Arbeit" (cdr result)))))
132 (ert-deftest icalendar--convert-weekly-to-ical ()
133 "Test method for `icalendar--convert-weekly-to-ical'."
134 (let* ((calendar-date-style 'iso)
135 result
136 (calendar-day-name-array
137 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
138 "Saturday"]))
139 (setq result (icalendar--convert-weekly-to-ical "" "Monday 8:30 subject"))
140 (should (consp result))
141 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20050103T083000"
142 "\nDTEND;VALUE=DATE-TIME:20050103T093000"
143 "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO")
144 (car result)))
145 (should (string= "subject" (cdr result)))))
147 (ert-deftest icalendar--convert-sexp-to-ical ()
148 "Test method for `icalendar--convert-sexp-to-ical'."
149 (let* (result
150 (icalendar-export-sexp-enumeration-days 3))
151 ;; test case %%(diary-hebrew-date)
152 (setq result (icalendar--convert-sexp-to-ical "" "%%(diary-hebrew-date)"))
153 (should (consp result))
154 (should (eq icalendar-export-sexp-enumeration-days (length result)))
155 (mapc (lambda (i)
156 (should (consp i))
157 (should (string-match "Hebrew date (until sunset): .*" (cdr i))))
158 result)))
160 (ert-deftest icalendar--convert-to-ical ()
161 "Test method for `icalendar--convert-to-ical'."
162 (let* (result
163 (icalendar-export-sexp-enumerate-all t)
164 (icalendar-export-sexp-enumeration-days 3)
165 (calendar-date-style 'iso))
166 ;; test case: %%(diary-anniversary 1642 12 25) Newton
167 ;; forced enumeration not matching the actual day --> empty
168 (setq result (icalendar--convert-sexp-to-ical
169 "" "%%(diary-anniversary 1642 12 25) Newton's birthday"
170 (encode-time 1 1 1 6 12 2014)))
171 (should (null result))
172 ;; test case: %%(diary-anniversary 1642 12 25) Newton
173 ;; enumeration does match the actual day -->
174 (setq result (icalendar--convert-sexp-to-ical
175 "" "%%(diary-anniversary 1642 12 25) Newton's birthday"
176 (encode-time 1 1 1 24 12 2014)))
177 (should (= 1 (length result)))
178 (should (consp (car result)))
179 (should (string-match
180 "\nDTSTART;VALUE=DATE:20141225\nDTEND;VALUE=DATE:20141226"
181 (car (car result))))
182 (should (string-match "Newton's birthday" (cdr (car result))))))
184 (ert-deftest icalendar--parse-vtimezone ()
185 "Test method for `icalendar--parse-vtimezone'."
186 (let (vtimezone result)
187 (setq vtimezone (icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
188 TZID:thename
189 BEGIN:STANDARD
190 DTSTART:16010101T040000
191 TZOFFSETFROM:+0300
192 TZOFFSETTO:+0200
193 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
194 END:STANDARD
195 BEGIN:DAYLIGHT
196 DTSTART:16010101T030000
197 TZOFFSETFROM:+0200
198 TZOFFSETTO:+0300
199 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
200 END:DAYLIGHT
201 END:VTIMEZONE
203 (setq result (icalendar--parse-vtimezone vtimezone))
204 (should (string= "thename" (car result)))
205 (message (cdr result))
206 (should (string= "STD-02:00DST-03:00,M3.5.0/03:00:00,M10.5.0/04:00:00"
207 (cdr result)))
208 (setq vtimezone (icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
209 TZID:anothername, with a comma
210 BEGIN:STANDARD
211 DTSTART:16010101T040000
212 TZOFFSETFROM:+0300
213 TZOFFSETTO:+0200
214 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=10
215 END:STANDARD
216 BEGIN:DAYLIGHT
217 DTSTART:16010101T030000
218 TZOFFSETFROM:+0200
219 TZOFFSETTO:+0300
220 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2MO;BYMONTH=3
221 END:DAYLIGHT
222 END:VTIMEZONE
224 (setq result (icalendar--parse-vtimezone vtimezone))
225 (should (string= "anothername, with a comma" (car result)))
226 (message (cdr result))
227 (should (string= "STD-02:00DST-03:00,M3.2.1/03:00:00,M10.2.1/04:00:00"
228 (cdr result)))
229 ;; offsetfrom = offsetto
230 (setq vtimezone (icalendar-tests--get-ical-event "BEGIN:VTIMEZONE
231 TZID:Kolkata, Chennai, Mumbai, New Delhi
232 X-MICROSOFT-CDO-TZID:23
233 BEGIN:STANDARD
234 DTSTART:16010101T000000
235 TZOFFSETFROM:+0530
236 TZOFFSETTO:+0530
237 END:STANDARD
238 BEGIN:DAYLIGHT
239 DTSTART:16010101T000000
240 TZOFFSETFROM:+0530
241 TZOFFSETTO:+0530
242 END:DAYLIGHT
243 END:VTIMEZONE
245 (setq result (icalendar--parse-vtimezone vtimezone))
246 (should (string= "Kolkata, Chennai, Mumbai, New Delhi" (car result)))
247 (message (cdr result))
248 (should (string= "STD-05:30DST-05:30,M1.1.1/00:00:00,M1.1.1/00:00:00"
249 (cdr result)))))
251 (ert-deftest icalendar--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 (should (consp result))
258 (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216"
259 (car result)))
260 (should (string= "subject" (cdr result)))
262 ;; with start time
263 (setq result (icalendar--convert-ordinary-to-ical
264 "&?" "&2010 2 15 12:34 s"))
265 (should (consp result))
266 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
267 "\nDTEND;VALUE=DATE-TIME:20100215T133400")
268 (car result)))
269 (should (string= "s" (cdr result)))
271 ;; with time
272 (setq result (icalendar--convert-ordinary-to-ical
273 "&?" "&2010 2 15 12:34-23:45 s"))
274 (should (consp result))
275 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400"
276 "\nDTEND;VALUE=DATE-TIME:20100215T234500")
277 (car result)))
278 (should (string= "s" (cdr result)))
280 ;; with time, again -- test bug#5549
281 (setq result (icalendar--convert-ordinary-to-ical
282 "x?" "x2010 2 15 0:34-1:45 s"))
283 (should (consp result))
284 (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400"
285 "\nDTEND;VALUE=DATE-TIME:20100215T014500")
286 (car result)))
287 (should (string= "s" (cdr result)))))
289 (ert-deftest icalendar--diarytime-to-isotime ()
290 "Test method for `icalendar--diarytime-to-isotime'."
291 (should (string= "T011500"
292 (icalendar--diarytime-to-isotime "01:15" "")))
293 (should (string= "T011500"
294 (icalendar--diarytime-to-isotime "1:15" "")))
295 (should (string= "T000100"
296 (icalendar--diarytime-to-isotime "0:01" "")))
297 (should (string= "T010000"
298 (icalendar--diarytime-to-isotime "0100" "")))
299 (should (string= "T010000"
300 (icalendar--diarytime-to-isotime "0100" "am")))
301 (should (string= "T130000"
302 (icalendar--diarytime-to-isotime "0100" "pm")))
303 (should (string= "T120000"
304 (icalendar--diarytime-to-isotime "1200" "")))
305 (should (string= "T171700"
306 (icalendar--diarytime-to-isotime "17:17" "")))
307 (should (string= "T000000"
308 (icalendar--diarytime-to-isotime "1200" "am")))
309 (should (string= "T000100"
310 (icalendar--diarytime-to-isotime "1201" "am")))
311 (should (string= "T005900"
312 (icalendar--diarytime-to-isotime "1259" "am")))
313 (should (string= "T120000"
314 (icalendar--diarytime-to-isotime "1200" "pm")))
315 (should (string= "T120100"
316 (icalendar--diarytime-to-isotime "1201" "pm")))
317 (should (string= "T125900"
318 (icalendar--diarytime-to-isotime "1259" "pm")))
319 (should (string= "T150000"
320 (icalendar--diarytime-to-isotime "3" "pm"))))
322 (ert-deftest icalendar--datetime-to-diary-date ()
323 "Test method for `icalendar--datetime-to-diary-date'."
324 (let* ((datetime '(59 59 23 31 12 2008))
325 (calendar-date-style 'iso))
326 (should (string= "2008 12 31"
327 (icalendar--datetime-to-diary-date datetime)))
328 (setq calendar-date-style 'european)
329 (should (string= "31 12 2008"
330 (icalendar--datetime-to-diary-date datetime)))
331 (setq calendar-date-style 'american)
332 (should (string= "12 31 2008"
333 (icalendar--datetime-to-diary-date datetime)))))
335 (ert-deftest icalendar--datestring-to-isodate ()
336 "Test method for `icalendar--datestring-to-isodate'."
337 (let ((calendar-date-style 'iso))
338 ;; numeric iso
339 (should (string= "20080511"
340 (icalendar--datestring-to-isodate "2008 05 11")))
341 (should (string= "20080531"
342 (icalendar--datestring-to-isodate "2008 05 31")))
343 (should (string= "20080602"
344 (icalendar--datestring-to-isodate "2008 05 31" 2)))
346 ;; numeric european
347 (setq calendar-date-style 'european)
348 (should (string= "20080511"
349 (icalendar--datestring-to-isodate "11 05 2008")))
350 (should (string= "20080531"
351 (icalendar--datestring-to-isodate "31 05 2008")))
352 (should (string= "20080602"
353 (icalendar--datestring-to-isodate "31 05 2008" 2)))
355 ;; numeric american
356 (setq calendar-date-style 'american)
357 (should (string= "20081105"
358 (icalendar--datestring-to-isodate "11 05 2008")))
359 (should (string= "20081230"
360 (icalendar--datestring-to-isodate "12 30 2008")))
361 (should (string= "20090101"
362 (icalendar--datestring-to-isodate "12 30 2008" 2)))
364 ;; non-numeric
365 (setq calendar-date-style nil) ;not necessary for conversion
366 (should (string= "20081105"
367 (icalendar--datestring-to-isodate "Nov 05 2008")))
368 (should (string= "20081105"
369 (icalendar--datestring-to-isodate "05 Nov 2008")))
370 (should (string= "20081105"
371 (icalendar--datestring-to-isodate "2008 Nov 05")))))
373 (ert-deftest icalendar--first-weekday-of-year ()
374 "Test method for `icalendar-first-weekday-of-year'."
375 (should (eq 1 (icalendar-first-weekday-of-year "TU" 2008)))
376 (should (eq 3 (icalendar-first-weekday-of-year "WE" 2007)))
377 (should (eq 5 (icalendar-first-weekday-of-year "TH" 2006)))
378 (should (eq 7 (icalendar-first-weekday-of-year "FR" 2005)))
379 (should (eq 3 (icalendar-first-weekday-of-year "SA" 2004)))
380 (should (eq 5 (icalendar-first-weekday-of-year "SU" 2003)))
381 (should (eq 7 (icalendar-first-weekday-of-year "MO" 2002)))
382 (should (eq 3 (icalendar-first-weekday-of-year "MO" 2000)))
383 (should (eq 1 (icalendar-first-weekday-of-year "TH" 1970))))
385 (ert-deftest icalendar--import-format-sample ()
386 "Test method for `icalendar-import-format-sample'."
387 (should (string= (concat "SUMMARY='a' DESCRIPTION='b' LOCATION='c' "
388 "ORGANIZER='d' STATUS='' URL='' CLASS=''")
389 (icalendar-import-format-sample
390 (icalendar-tests--get-ical-event "BEGIN:VEVENT
391 DTSTAMP:20030509T043439Z
392 DTSTART:20030509T103000
393 SUMMARY:a
394 ORGANIZER:d
395 LOCATION:c
396 DTEND:20030509T153000
397 DESCRIPTION:b
398 END:VEVENT
399 ")))))
401 (ert-deftest icalendar--format-ical-event ()
402 "Test `icalendar--format-ical-event'."
403 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
404 (icalendar-import-format-summary "SUM %s")
405 (icalendar-import-format-location " LOC %s")
406 (icalendar-import-format-description " DES %s")
407 (icalendar-import-format-organizer " ORG %s")
408 (icalendar-import-format-status " STA %s")
409 (icalendar-import-format-url " URL %s")
410 (icalendar-import-format-class " CLA %s")
411 (event (icalendar-tests--get-ical-event "BEGIN:VEVENT
412 DTSTAMP:20030509T043439Z
413 DTSTART:20030509T103000
414 SUMMARY:sum
415 ORGANIZER:org
416 LOCATION:loc
417 DTEND:20030509T153000
418 DESCRIPTION:des
419 END:VEVENT
420 ")))
421 (should (string= "SUM sum DES des LOC loc ORG org"
422 (icalendar--format-ical-event event)))
423 (setq icalendar-import-format (lambda (&rest ignore)
424 "helloworld"))
425 (should (string= "helloworld" (icalendar--format-ical-event event)))
426 (setq icalendar-import-format
427 (lambda (e)
428 (format "-%s-%s-%s-%s-%s-%s-%s-"
429 (icalendar--get-event-property event 'SUMMARY)
430 (icalendar--get-event-property event 'DESCRIPTION)
431 (icalendar--get-event-property event 'LOCATION)
432 (icalendar--get-event-property event 'ORGANIZER)
433 (icalendar--get-event-property event 'STATUS)
434 (icalendar--get-event-property event 'URL)
435 (icalendar--get-event-property event 'CLASS))))
436 (should (string= "-sum-des-loc-org-nil-nil-nil-"
437 (icalendar--format-ical-event event)))))
439 (ert-deftest icalendar--parse-summary-and-rest ()
440 "Test `icalendar--parse-summary-and-rest'."
441 (let ((icalendar-import-format "%s%d%l%o%t%u%c")
442 (icalendar-import-format-summary "SUM %s")
443 (icalendar-import-format-location " LOC %s")
444 (icalendar-import-format-description " DES %s")
445 (icalendar-import-format-organizer " ORG %s")
446 (icalendar-import-format-status " STA %s")
447 (icalendar-import-format-url " URL %s")
448 (icalendar-import-format-class " CLA %s")
449 (result))
450 (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org"))
451 (should (string= "org" (cdr (assoc 'org result))))
453 (setq result (icalendar--parse-summary-and-rest
454 "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla"))
455 (should (string= "des" (cdr (assoc 'des result))))
456 (should (string= "loc" (cdr (assoc 'loc result))))
457 (should (string= "org" (cdr (assoc 'org result))))
458 (should (string= "sta" (cdr (assoc 'sta result))))
459 (should (string= "cla" (cdr (assoc 'cla result))))
461 (setq icalendar-import-format (lambda () "Hello world"))
462 (setq result (icalendar--parse-summary-and-rest
463 "blah blah "))
464 (should (not result))
467 (ert-deftest icalendar--decode-isodatetime ()
468 "Test `icalendar--decode-isodatetime'."
469 (let ((tz (getenv "TZ"))
470 result)
471 (unwind-protect
472 (progn
473 ;; Use Eastern European Time (UTC+2, UTC+3 daylight saving)
474 (setenv "TZ" "EET-2EEST,M3.5.0/3,M10.5.0/4")
476 (message "%s" (current-time-zone (encode-time 0 0 10 1 1 2013 0)))
477 (message "%s" (current-time-zone (encode-time 0 0 10 1 8 2013 0)))
479 ;; testcase: no time zone in input -> keep time as is
480 ;; 1 Jan 2013 10:00
481 (should (equal '(0 0 10 1 1 2013 2 nil 7200)
482 (icalendar--decode-isodatetime "20130101T100000")))
483 ;; 1 Aug 2013 10:00 (DST)
484 (should (equal '(0 0 10 1 8 2013 4 t 10800)
485 (icalendar--decode-isodatetime "20130801T100000")))
487 ;; testcase: UTC time zone specifier in input -> convert to local time
488 ;; 31 Dec 2013 23:00 UTC -> 1 Jan 2013 01:00 EET
489 (should (equal '(0 0 1 1 1 2014 3 nil 7200)
490 (icalendar--decode-isodatetime "20131231T230000Z")))
491 ;; 1 Aug 2013 10:00 UTC -> 1 Aug 2013 13:00 EEST
492 (should (equal '(0 0 13 1 8 2013 4 t 10800)
493 (icalendar--decode-isodatetime "20130801T100000Z")))
496 ;; restore time-zone even if something went terribly wrong
497 (setenv "TZ" tz))) )
499 ;; ======================================================================
500 ;; Export tests
501 ;; ======================================================================
503 (defun icalendar-tests--test-export (input-iso input-european input-american
504 expected-output &optional alarms)
505 "Perform an export test.
506 Argument INPUT-ISO iso style diary string.
507 Argument INPUT-EUROPEAN european style diary string.
508 Argument INPUT-AMERICAN american style diary string.
509 Argument EXPECTED-OUTPUT expected iCalendar result string.
510 Optional argument ALARMS the value of `icalendar-export-alarms' for this test.
512 European style input data must use german month names. American
513 and ISO style input data must use english month names."
514 (let ((tz (getenv "TZ"))
515 (calendar-date-style 'iso)
516 (icalendar-recurring-start-year 2000)
517 (icalendar-export-alarms alarms))
518 (unwind-protect
519 (progn
520 ;;; (message "Current time zone: %s" (current-time-zone))
521 ;; Use this form so as not to rely on system tz database.
522 ;; Eg hydra.nixos.org.
523 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
524 ;;; (message "Current time zone: %s" (current-time-zone))
525 (when input-iso
526 (let ((calendar-month-name-array
527 ["January" "February" "March" "April" "May" "June" "July" "August"
528 "September" "October" "November" "December"])
529 (calendar-day-name-array
530 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
531 "Saturday"]))
532 (setq calendar-date-style 'iso)
533 (icalendar-tests--do-test-export input-iso expected-output)))
534 (when input-european
535 (let ((calendar-month-name-array
536 ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August"
537 "September" "Oktober" "November" "Dezember"])
538 (calendar-day-name-array
539 ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag"
540 "Samstag"]))
541 (setq calendar-date-style 'european)
542 (icalendar-tests--do-test-export input-european expected-output)))
543 (when input-american
544 (let ((calendar-month-name-array
545 ["January" "February" "March" "April" "May" "June" "July" "August"
546 "September" "October" "November" "December"])
547 (calendar-day-name-array
548 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"
549 "Saturday"]))
550 (setq calendar-date-style 'american)
551 (icalendar-tests--do-test-export input-american expected-output))))
552 ;; restore time-zone even if something went terribly wrong
553 (setenv "TZ" tz))))
555 (defun icalendar-tests--do-test-export (input expected-output)
556 "Actually perform export test.
557 Argument INPUT input diary string.
558 Argument EXPECTED-OUTPUT expected iCalendar result string."
559 (let ((temp-file (make-temp-file "icalendar-tests-ics")))
560 (unwind-protect
561 (progn
562 (with-temp-buffer
563 (insert input)
564 (icalendar-export-region (point-min) (point-max) temp-file))
565 (save-excursion
566 (find-file temp-file)
567 (goto-char (point-min))
568 (cond (expected-output
569 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
570 PRODID:-//Emacs//NONSGML icalendar.el//EN
571 VERSION:2.0
572 BEGIN:VEVENT
573 UID:emacs[0-9]+
574 \\(\\(.\\|\n\\)+\\)
575 END:VEVENT
576 END:VCALENDAR
577 \\s-*$"
578 nil t))
579 (should (string-match
580 (concat "^\\s-*"
581 (regexp-quote (buffer-substring-no-properties
582 (match-beginning 1) (match-end 1)))
583 "\\s-*$")
584 expected-output)))
586 (should (re-search-forward "^\\s-*BEGIN:VCALENDAR
587 PRODID:-//Emacs//NONSGML icalendar.el//EN
588 VERSION:2.0
589 END:VCALENDAR
590 \\s-*$"
591 nil t))))))
592 ;; cleanup!!
593 (kill-buffer (find-buffer-visiting temp-file))
594 (delete-file temp-file))))
596 (ert-deftest icalendar-export-ordinary-no-time ()
597 "Perform export test."
599 (let ((icalendar-export-hidden-diary-entries nil))
600 (icalendar-tests--test-export
601 "&2000 Oct 3 ordinary no time "
602 "&3 Okt 2000 ordinary no time "
603 "&Oct 3 2000 ordinary no time "
604 nil))
606 (icalendar-tests--test-export
607 "2000 Oct 3 ordinary no time "
608 "3 Okt 2000 ordinary no time "
609 "Oct 3 2000 ordinary no time "
610 "DTSTART;VALUE=DATE:20001003
611 DTEND;VALUE=DATE:20001004
612 SUMMARY:ordinary no time
615 (ert-deftest icalendar-export-ordinary ()
616 "Perform export test."
618 (icalendar-tests--test-export
619 "2000 Oct 3 16:30 ordinary with time"
620 "3 Okt 2000 16:30 ordinary with time"
621 "Oct 3 2000 16:30 ordinary with time"
622 "DTSTART;VALUE=DATE-TIME:20001003T163000
623 DTEND;VALUE=DATE-TIME:20001003T173000
624 SUMMARY:ordinary with time
626 (icalendar-tests--test-export
627 "2000 10 3 16:30 ordinary with time 2"
628 "3 10 2000 16:30 ordinary with time 2"
629 "10 3 2000 16:30 ordinary with time 2"
630 "DTSTART;VALUE=DATE-TIME:20001003T163000
631 DTEND;VALUE=DATE-TIME:20001003T173000
632 SUMMARY:ordinary with time 2
635 (icalendar-tests--test-export
636 "2000/10/3 16:30 ordinary with time 3"
637 "3/10/2000 16:30 ordinary with time 3"
638 "10/3/2000 16:30 ordinary with time 3"
639 "DTSTART;VALUE=DATE-TIME:20001003T163000
640 DTEND;VALUE=DATE-TIME:20001003T173000
641 SUMMARY:ordinary with time 3
644 (ert-deftest icalendar-export-multiline ()
645 "Perform export test."
647 ;; multiline -- FIXME!!!
648 (icalendar-tests--test-export
649 "2000 October 3 16:30 multiline
650 17:30 multiline continued FIXME"
651 "3 Oktober 2000 16:30 multiline
652 17:30 multiline continued FIXME"
653 "October 3 2000 16:30 multiline
654 17:30 multiline continued FIXME"
655 "DTSTART;VALUE=DATE-TIME:20001003T163000
656 DTEND;VALUE=DATE-TIME:20001003T173000
657 SUMMARY:multiline
658 DESCRIPTION:
659 17:30 multiline continued FIXME
662 (ert-deftest icalendar-export-weekly-by-day ()
663 "Perform export test."
665 ;; weekly by day
666 (icalendar-tests--test-export
667 "Monday 1:30pm weekly by day with start time"
668 "Montag 13:30 weekly by day with start time"
669 "Monday 1:30pm weekly by day with start time"
670 "DTSTART;VALUE=DATE-TIME:20000103T133000
671 DTEND;VALUE=DATE-TIME:20000103T143000
672 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
673 SUMMARY:weekly by day with start time
676 (icalendar-tests--test-export
677 "Monday 13:30-15:00 weekly by day with start and end time"
678 "Montag 13:30-15:00 weekly by day with start and end time"
679 "Monday 01:30pm-03:00pm weekly by day with start and end time"
680 "DTSTART;VALUE=DATE-TIME:20000103T133000
681 DTEND;VALUE=DATE-TIME:20000103T150000
682 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
683 SUMMARY:weekly by day with start and end time
686 (ert-deftest icalendar-export-yearly ()
687 "Perform export test."
688 ;; yearly
689 (icalendar-tests--test-export
690 "may 1 yearly no time"
691 "1 Mai yearly no time"
692 "may 1 yearly no time"
693 "DTSTART;VALUE=DATE:19000501
694 DTEND;VALUE=DATE:19000502
695 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1
696 SUMMARY:yearly no time
699 (ert-deftest icalendar-export-anniversary ()
700 "Perform export test."
701 ;; anniversaries
702 (icalendar-tests--test-export
703 "%%(diary-anniversary 1989 10 3) anniversary no time"
704 "%%(diary-anniversary 3 10 1989) anniversary no time"
705 "%%(diary-anniversary 10 3 1989) anniversary no time"
706 "DTSTART;VALUE=DATE:19891003
707 DTEND;VALUE=DATE:19891004
708 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
709 SUMMARY:anniversary no time
711 (icalendar-tests--test-export
712 "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
713 "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
714 "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
715 "DTSTART;VALUE=DATE-TIME:19891003T190000
716 DTEND;VALUE=DATE-TIME:19891004T200000
717 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
718 SUMMARY:anniversary with time
721 (ert-deftest icalendar-export-block ()
722 "Perform export test."
723 ;; block
724 (icalendar-tests--test-export
725 "%%(diary-block 2001 6 18 2001 7 6) block no time"
726 "%%(diary-block 18 6 2001 6 7 2001) block no time"
727 "%%(diary-block 6 18 2001 7 6 2001) block no time"
728 "DTSTART;VALUE=DATE:20010618
729 DTEND;VALUE=DATE:20010707
730 SUMMARY:block no time
732 (icalendar-tests--test-export
733 "%%(diary-block 2001 6 18 2001 7 6) 13:00-17:00 block with time"
734 "%%(diary-block 18 6 2001 6 7 2001) 13:00-17:00 block with time"
735 "%%(diary-block 6 18 2001 7 6 2001) 13:00-17:00 block with time"
736 "DTSTART;VALUE=DATE-TIME:20010618T130000
737 DTEND;VALUE=DATE-TIME:20010618T170000
738 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
739 SUMMARY:block with time
741 (icalendar-tests--test-export
742 "%%(diary-block 2001 6 18 2001 7 6) 13:00 block no end time"
743 "%%(diary-block 18 6 2001 6 7 2001) 13:00 block no end time"
744 "%%(diary-block 6 18 2001 7 6 2001) 13:00 block no end time"
745 "DTSTART;VALUE=DATE-TIME:20010618T130000
746 DTEND;VALUE=DATE-TIME:20010618T140000
747 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706
748 SUMMARY:block no end time
751 (ert-deftest icalendar-export-alarms ()
752 "Perform export test with different settings for exporting alarms."
753 ;; no alarm
754 (icalendar-tests--test-export
755 "2014 Nov 17 19:30 no alarm"
756 "17 Nov 2014 19:30 no alarm"
757 "Nov 17 2014 19:30 no alarm"
758 "DTSTART;VALUE=DATE-TIME:20141117T193000
759 DTEND;VALUE=DATE-TIME:20141117T203000
760 SUMMARY:no alarm
762 nil)
764 ;; 10 minutes in advance, audio
765 (icalendar-tests--test-export
766 "2014 Nov 17 19:30 audio alarm"
767 "17 Nov 2014 19:30 audio alarm"
768 "Nov 17 2014 19:30 audio alarm"
769 "DTSTART;VALUE=DATE-TIME:20141117T193000
770 DTEND;VALUE=DATE-TIME:20141117T203000
771 SUMMARY:audio alarm
772 BEGIN:VALARM
773 ACTION:AUDIO
774 TRIGGER:-PT10M
775 END:VALARM
777 '(10 ((audio))))
779 ;; 20 minutes in advance, display
780 (icalendar-tests--test-export
781 "2014 Nov 17 19:30 display alarm"
782 "17 Nov 2014 19:30 display alarm"
783 "Nov 17 2014 19:30 display alarm"
784 "DTSTART;VALUE=DATE-TIME:20141117T193000
785 DTEND;VALUE=DATE-TIME:20141117T203000
786 SUMMARY:display alarm
787 BEGIN:VALARM
788 ACTION:DISPLAY
789 TRIGGER:-PT20M
790 DESCRIPTION:display alarm
791 END:VALARM
793 '(20 ((display))))
795 ;; 66 minutes in advance, email
796 (icalendar-tests--test-export
797 "2014 Nov 17 19:30 email alarm"
798 "17 Nov 2014 19:30 email alarm"
799 "Nov 17 2014 19:30 email alarm"
800 "DTSTART;VALUE=DATE-TIME:20141117T193000
801 DTEND;VALUE=DATE-TIME:20141117T203000
802 SUMMARY:email alarm
803 BEGIN:VALARM
804 ACTION:EMAIL
805 TRIGGER:-PT66M
806 DESCRIPTION:email alarm
807 SUMMARY:email alarm
808 ATTENDEE:MAILTO:att.one@email.com
809 ATTENDEE:MAILTO:att.two@email.com
810 END:VALARM
812 '(66 ((email ("att.one@email.com" "att.two@email.com")))))
814 ;; 2 minutes in advance, all alarms
815 (icalendar-tests--test-export
816 "2014 Nov 17 19:30 all alarms"
817 "17 Nov 2014 19:30 all alarms"
818 "Nov 17 2014 19:30 all alarms"
819 "DTSTART;VALUE=DATE-TIME:20141117T193000
820 DTEND;VALUE=DATE-TIME:20141117T203000
821 SUMMARY:all alarms
822 BEGIN:VALARM
823 ACTION:EMAIL
824 TRIGGER:-PT2M
825 DESCRIPTION:all alarms
826 SUMMARY:all alarms
827 ATTENDEE:MAILTO:att.one@email.com
828 ATTENDEE:MAILTO:att.two@email.com
829 END:VALARM
830 BEGIN:VALARM
831 ACTION:AUDIO
832 TRIGGER:-PT2M
833 END:VALARM
834 BEGIN:VALARM
835 ACTION:DISPLAY
836 TRIGGER:-PT2M
837 DESCRIPTION:all alarms
838 END:VALARM
840 '(2 ((email ("att.one@email.com" "att.two@email.com")) (audio) (display)))))
842 ;; ======================================================================
843 ;; Import tests
844 ;; ======================================================================
846 (defun icalendar-tests--test-import (input expected-iso expected-european
847 expected-american)
848 "Perform import test.
849 Argument INPUT icalendar event string.
850 Argument EXPECTED-ISO expected iso style diary string.
851 Argument EXPECTED-EUROPEAN expected european style diary string.
852 Argument EXPECTED-AMERICAN expected american style diary string.
853 During import test the timezone is set to Central European Time."
854 (let ((timezone (getenv "TZ")))
855 (unwind-protect
856 (progn
857 ;; Use this form so as not to rely on system tz database.
858 ;; Eg hydra.nixos.org.
859 (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
860 (with-temp-buffer
861 (if (string-match "^BEGIN:VCALENDAR" input)
862 (insert input)
863 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
864 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
865 (insert input)
866 (unless (eq (char-before) ?\n)
867 (insert "\n"))
868 (insert "END:VEVENT\nEND:VCALENDAR\n"))
869 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
870 (icalendar-import-format-summary "%s")
871 (icalendar-import-format-location "\n Location: %s")
872 (icalendar-import-format-description "\n Desc: %s")
873 (icalendar-import-format-organizer "\n Organizer: %s")
874 (icalendar-import-format-status "\n Status: %s")
875 (icalendar-import-format-url "\n URL: %s")
876 (icalendar-import-format-class "\n Class: %s")
877 (icalendar-import-format-uid "\n UID: %s")
878 calendar-date-style)
879 (when expected-iso
880 (setq calendar-date-style 'iso)
881 (icalendar-tests--do-test-import input expected-iso))
882 (when expected-european
883 (setq calendar-date-style 'european)
884 (icalendar-tests--do-test-import input expected-european))
885 (when expected-american
886 (setq calendar-date-style 'american)
887 (icalendar-tests--do-test-import input expected-american)))))
888 (setenv "TZ" timezone))))
890 (defun icalendar-tests--do-test-import (input expected-output)
891 "Actually perform import test.
892 Argument INPUT input icalendar string.
893 Argument EXPECTED-OUTPUT expected diary string."
894 (let ((temp-file (make-temp-file "icalendar-test-diary")))
895 ;; Test the Catch-the-mysterious-coding-header logic below.
896 ;; Ruby-mode adds an after-save-hook which inserts the header!
897 ;; (save-excursion
898 ;; (find-file temp-file)
899 ;; (ruby-mode))
900 (icalendar-import-buffer temp-file t t)
901 (save-excursion
902 (find-file temp-file)
903 ;; Check for the mysterious "# coding: ..." header, remove it
904 ;; and give a shout
905 (goto-char (point-min))
906 (when (re-search-forward "# coding: .*?\n" nil t)
907 (message (concat "%s\n"
908 "Found mysterious \"# coding ...\" header! Removing it.\n"
909 "Current Modes: %s, %s\n"
910 "Current test: %s\n"
911 "%s")
912 (make-string 70 ?*)
913 major-mode
914 minor-mode-list
915 (ert-running-test)
916 (make-string 70 ?*))
917 (buffer-disable-undo)
918 (replace-match "")
919 (set-buffer-modified-p nil))
921 (let ((result (buffer-substring-no-properties (point-min) (point-max))))
922 (should (string= expected-output result)))
923 (kill-buffer (find-buffer-visiting temp-file))
924 (delete-file temp-file))))
926 (ert-deftest icalendar-import-non-recurring ()
927 "Perform standard import tests."
928 (icalendar-tests--test-import
929 "SUMMARY:non-recurring
930 DTSTART;VALUE=DATE-TIME:20030919T090000
931 DTEND;VALUE=DATE-TIME:20030919T113000"
932 "&2003/9/19 09:00-11:30 non-recurring\n"
933 "&19/9/2003 09:00-11:30 non-recurring\n"
934 "&9/19/2003 09:00-11:30 non-recurring\n")
935 (icalendar-tests--test-import
936 "SUMMARY:non-recurring allday
937 DTSTART;VALUE=DATE-TIME:20030919"
938 "&2003/9/19 non-recurring allday\n"
939 "&19/9/2003 non-recurring allday\n"
940 "&9/19/2003 non-recurring allday\n")
941 (icalendar-tests--test-import
942 ;; Checkdoc removes trailing blanks. Therefore: format!
943 (format "%s\n%s\n%s" "SUMMARY:long " " summary"
944 "DTSTART;VALUE=DATE:20030919")
945 "&2003/9/19 long summary\n"
946 "&19/9/2003 long summary\n"
947 "&9/19/2003 long summary\n")
948 (icalendar-tests--test-import
949 "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61
950 SUMMARY:Sommerferien
951 STATUS:TENTATIVE
952 CLASS:PRIVATE
953 X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten
954 X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
955 DTSTART;VALUE=DATE:20040719
956 DTEND;VALUE=DATE:20040828
957 DTSTAMP:20031103T011641Z
959 "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien
960 Status: TENTATIVE
961 Class: PRIVATE
962 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
964 "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien
965 Status: TENTATIVE
966 Class: PRIVATE
967 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
969 "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien
970 Status: TENTATIVE
971 Class: PRIVATE
972 UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61
974 (icalendar-tests--test-import
975 "UID
976 :04979712-3902-11d9-93dd-8f9f4afe08da
977 SUMMARY
978 :folded summary
979 STATUS
980 :TENTATIVE
981 CLASS
982 :PRIVATE
983 X-MOZILLA-ALARM-DEFAULT-LENGTH
985 DTSTART
986 :20041123T140000
987 DTEND
988 :20041123T143000
989 DTSTAMP
990 :20041118T013430Z
991 LAST-MODIFIED
992 :20041118T013640Z
994 "&2004/11/23 14:00-14:30 folded summary
995 Status: TENTATIVE
996 Class: PRIVATE
997 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
998 "&23/11/2004 14:00-14:30 folded summary
999 Status: TENTATIVE
1000 Class: PRIVATE
1001 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n"
1002 "&11/23/2004 14:00-14:30 folded summary
1003 Status: TENTATIVE
1004 Class: PRIVATE
1005 UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n")
1007 (icalendar-tests--test-import
1008 "UID
1009 :6161a312-3902-11d9-b512-f764153bb28b
1010 SUMMARY
1011 :another example
1012 STATUS
1013 :TENTATIVE
1014 CLASS
1015 :PRIVATE
1016 X-MOZILLA-ALARM-DEFAULT-LENGTH
1018 DTSTART
1019 :20041123T144500
1020 DTEND
1021 :20041123T154500
1022 DTSTAMP
1023 :20041118T013641Z
1025 "&2004/11/23 14:45-15:45 another example
1026 Status: TENTATIVE
1027 Class: PRIVATE
1028 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
1029 "&23/11/2004 14:45-15:45 another example
1030 Status: TENTATIVE
1031 Class: PRIVATE
1032 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"
1033 "&11/23/2004 14:45-15:45 another example
1034 Status: TENTATIVE
1035 Class: PRIVATE
1036 UID: 6161a312-3902-11d9-b512-f764153bb28b\n"))
1038 (ert-deftest icalendar-import-rrule ()
1039 (icalendar-tests--test-import
1040 "SUMMARY:rrule daily
1041 DTSTART;VALUE=DATE-TIME:20030919T090000
1042 DTEND;VALUE=DATE-TIME:20030919T113000
1043 RRULE:FREQ=DAILY;
1045 "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily\n"
1046 "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily\n"
1047 "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily\n")
1048 ;; RRULE examples
1049 (icalendar-tests--test-import
1050 "SUMMARY:rrule daily
1051 DTSTART;VALUE=DATE-TIME:20030919T090000
1052 DTEND;VALUE=DATE-TIME:20030919T113000
1053 RRULE:FREQ=DAILY;INTERVAL=2
1055 "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily\n"
1056 "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily\n"
1057 "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily\n")
1058 (icalendar-tests--test-import
1059 "SUMMARY:rrule daily with exceptions
1060 DTSTART;VALUE=DATE-TIME:20030919T090000
1061 DTEND;VALUE=DATE-TIME:20030919T113000
1062 RRULE:FREQ=DAILY;INTERVAL=2
1063 EXDATE:20030921,20030925
1065 "&%%(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\n"
1066 "&%%(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\n"
1067 "&%%(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\n")
1068 (icalendar-tests--test-import
1069 "SUMMARY:rrule weekly
1070 DTSTART;VALUE=DATE-TIME:20030919T090000
1071 DTEND;VALUE=DATE-TIME:20030919T113000
1072 RRULE:FREQ=WEEKLY;
1074 "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly\n"
1075 "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly\n"
1076 "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly\n")
1077 (icalendar-tests--test-import
1078 "SUMMARY:rrule monthly no end
1079 DTSTART;VALUE=DATE-TIME:20030919T090000
1080 DTEND;VALUE=DATE-TIME:20030919T113000
1081 RRULE:FREQ=MONTHLY;
1083 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end\n"
1084 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n"
1085 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n")
1086 (icalendar-tests--test-import
1087 "SUMMARY:rrule monthly with end
1088 DTSTART;VALUE=DATE-TIME:20030919T090000
1089 DTEND;VALUE=DATE-TIME:20030919T113000
1090 RRULE:FREQ=MONTHLY;UNTIL=20050819;
1092 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end\n"
1093 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end\n"
1094 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end\n")
1095 (icalendar-tests--test-import
1096 "DTSTART;VALUE=DATE:20040815
1097 DTEND;VALUE=DATE:20040816
1098 SUMMARY:Maria Himmelfahrt
1099 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8
1101 "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt\n"
1102 "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt\n"
1103 "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt\n")
1104 (icalendar-tests--test-import
1105 "SUMMARY:rrule yearly
1106 DTSTART;VALUE=DATE-TIME:20030919T090000
1107 DTEND;VALUE=DATE-TIME:20030919T113000
1108 RRULE:FREQ=YEARLY;INTERVAL=2
1110 "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly\n" ;FIXME
1111 "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly\n" ;FIXME
1112 "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly\n") ;FIXME
1113 (icalendar-tests--test-import
1114 "SUMMARY:rrule count daily short
1115 DTSTART;VALUE=DATE-TIME:20030919T090000
1116 DTEND;VALUE=DATE-TIME:20030919T113000
1117 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1
1119 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short\n"
1120 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short\n"
1121 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short\n")
1122 (icalendar-tests--test-import
1123 "SUMMARY:rrule count daily long
1124 DTSTART;VALUE=DATE-TIME:20030919T090000
1125 DTEND;VALUE=DATE-TIME:20030919T113000
1126 RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1
1128 "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long\n"
1129 "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long\n"
1130 "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long\n")
1131 (icalendar-tests--test-import
1132 "SUMMARY:rrule count bi-weekly 3 times
1133 DTSTART;VALUE=DATE-TIME:20030919T090000
1134 DTEND;VALUE=DATE-TIME:20030919T113000
1135 RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2
1137 "&%%(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\n"
1138 "&%%(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\n"
1139 "&%%(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\n")
1140 (icalendar-tests--test-import
1141 "SUMMARY:rrule count monthly
1142 DTSTART;VALUE=DATE-TIME:20030919T090000
1143 DTEND;VALUE=DATE-TIME:20030919T113000
1144 RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5
1146 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly\n"
1147 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly\n"
1148 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly\n")
1149 (icalendar-tests--test-import
1150 "SUMMARY:rrule count every second month
1151 DTSTART;VALUE=DATE-TIME:20030919T090000
1152 DTEND;VALUE=DATE-TIME:20030919T113000
1153 RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5
1155 "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month\n" ;FIXME
1156 "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month\n" ;FIXME
1157 "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month\n") ;FIXME
1158 (icalendar-tests--test-import
1159 "SUMMARY:rrule count yearly
1160 DTSTART;VALUE=DATE-TIME:20030919T090000
1161 DTEND;VALUE=DATE-TIME:20030919T113000
1162 RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5
1164 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly\n"
1165 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly\n"
1166 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly\n")
1167 (icalendar-tests--test-import
1168 "SUMMARY:rrule count every second year
1169 DTSTART;VALUE=DATE-TIME:20030919T090000
1170 DTEND;VALUE=DATE-TIME:20030919T113000
1171 RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5
1173 "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year\n" ;FIXME!!!
1174 "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year\n" ;FIXME!!!
1175 "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year\n") ;FIXME!!!
1178 (ert-deftest icalendar-import-duration ()
1179 ;; duration
1180 (icalendar-tests--test-import
1181 "DTSTART;VALUE=DATE:20050217
1182 SUMMARY:duration
1183 DURATION:P7D
1185 "&%%(and (diary-block 2005 2 17 2005 2 23)) duration\n"
1186 "&%%(and (diary-block 17 2 2005 23 2 2005)) duration\n"
1187 "&%%(and (diary-block 2 17 2005 2 23 2005)) duration\n")
1188 (icalendar-tests--test-import
1189 "UID:20041127T183329Z-18215-1001-4536-49109@andromeda
1190 DTSTAMP:20041127T183315Z
1191 LAST-MODIFIED:20041127T183329
1192 SUMMARY:Urlaub
1193 DTSTART;VALUE=DATE:20011221
1194 DTEND;VALUE=DATE:20011221
1195 RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU
1196 CLASS:PUBLIC
1197 SEQUENCE:1
1198 CREATED:20041127T183329
1200 "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub
1201 Class: PUBLIC
1202 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1203 "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub
1204 Class: PUBLIC
1205 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"
1206 "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub
1207 Class: PUBLIC
1208 UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n"))
1210 (ert-deftest icalendar-import-bug-6766 ()
1211 ;;bug#6766 -- multiple byday values in a weekly rrule
1212 (icalendar-tests--test-import
1213 "CLASS:PUBLIC
1214 DTEND;TZID=America/New_York:20100421T120000
1215 DTSTAMP:20100525T141214Z
1216 DTSTART;TZID=America/New_York:20100421T113000
1217 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR
1218 SEQUENCE:1
1219 STATUS:CONFIRMED
1220 SUMMARY:Scrum
1221 TRANSP:OPAQUE
1222 UID:8814e3f9-7482-408f-996c-3bfe486a1262
1223 END:VEVENT
1224 BEGIN:VEVENT
1225 CLASS:PUBLIC
1226 DTSTAMP:20100525T141214Z
1227 DTSTART;VALUE=DATE:20100422
1228 DTEND;VALUE=DATE:20100423
1229 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH
1230 SEQUENCE:1
1231 SUMMARY:Tues + Thurs thinking
1232 TRANSP:OPAQUE
1233 UID:8814e3f9-7482-408f-996c-3bfe486a1263
1235 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum
1236 Status: CONFIRMED
1237 Class: PUBLIC
1238 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1239 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking
1240 Class: PUBLIC
1241 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1243 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum
1244 Status: CONFIRMED
1245 Class: PUBLIC
1246 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1247 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking
1248 Class: PUBLIC
1249 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1251 "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum
1252 Status: CONFIRMED
1253 Class: PUBLIC
1254 UID: 8814e3f9-7482-408f-996c-3bfe486a1262
1255 &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking
1256 Class: PUBLIC
1257 UID: 8814e3f9-7482-408f-996c-3bfe486a1263
1260 (ert-deftest icalendar-import-multiple-vcalendars ()
1261 (icalendar-tests--test-import
1262 "DTSTART;VALUE=DATE:20110723
1263 SUMMARY:event-1
1265 "&2011/7/23 event-1\n"
1266 "&23/7/2011 event-1\n"
1267 "&7/23/2011 event-1\n")
1269 (icalendar-tests--test-import
1270 "BEGIN:VCALENDAR
1271 PRODID:-//Emacs//NONSGML icalendar.el//EN
1272 VERSION:2.0\nBEGIN:VEVENT
1273 DTSTART;VALUE=DATE:20110723
1274 SUMMARY:event-1
1275 END:VEVENT
1276 END:VCALENDAR
1277 BEGIN:VCALENDAR
1278 PRODID:-//Emacs//NONSGML icalendar.el//EN
1279 VERSION:2.0
1280 BEGIN:VEVENT
1281 DTSTART;VALUE=DATE:20110724
1282 SUMMARY:event-2
1283 END:VEVENT
1284 END:VCALENDAR
1285 BEGIN:VCALENDAR
1286 PRODID:-//Emacs//NONSGML icalendar.el//EN
1287 VERSION:2.0
1288 BEGIN:VEVENT
1289 DTSTART;VALUE=DATE:20110725
1290 SUMMARY:event-3a
1291 END:VEVENT
1292 BEGIN:VEVENT
1293 DTSTART;VALUE=DATE:20110725
1294 SUMMARY:event-3b
1295 END:VEVENT
1296 END:VCALENDAR
1298 "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n"
1299 "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n"
1300 "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n"))
1302 (ert-deftest icalendar-import-with-uid ()
1303 "Perform import test with uid."
1304 (icalendar-tests--test-import
1305 "UID:1234567890uid
1306 SUMMARY:non-recurring
1307 DTSTART;VALUE=DATE-TIME:20030919T090000
1308 DTEND;VALUE=DATE-TIME:20030919T113000"
1309 "&2003/9/19 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1310 "&19/9/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1311 "&9/19/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"))
1313 (ert-deftest icalendar-import-with-timezone ()
1314 ;; This is known to fail on MS-Windows, because the test assumes
1315 ;; Posix features of specifying DST rules.
1316 :expected-result (if (memq system-type '(windows-nt ms-dos))
1317 :failed
1318 :passed)
1319 ;; bug#11473
1320 (icalendar-tests--test-import
1321 "BEGIN:VCALENDAR
1322 BEGIN:VTIMEZONE
1323 TZID:fictional, nonexistent, arbitrary
1324 BEGIN:STANDARD
1325 DTSTART:20100101T000000
1326 TZOFFSETFROM:+0200
1327 TZOFFSETTO:-0200
1328 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01
1329 END:STANDARD
1330 BEGIN:DAYLIGHT
1331 DTSTART:20101201T000000
1332 TZOFFSETFROM:-0200
1333 TZOFFSETTO:+0200
1334 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
1335 END:DAYLIGHT
1336 END:VTIMEZONE
1337 BEGIN:VEVENT
1338 SUMMARY:standardtime
1339 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000
1340 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000
1341 END:VEVENT
1342 BEGIN:VEVENT
1343 SUMMARY:daylightsavingtime
1344 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000
1345 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000
1346 END:VEVENT
1347 END:VCALENDAR"
1348 ;; "standardtime" begins first sunday in january and is 4 hours behind CET
1349 ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET
1350 "&2012/1/15 15:00-15:30 standardtime
1351 &2012/12/15 11:00-11:30 daylightsavingtime
1354 nil)
1356 ;; ======================================================================
1357 ;; Cycle
1358 ;; ======================================================================
1359 (defun icalendar-tests--test-cycle (input)
1360 "Perform cycle test.
1361 Argument INPUT icalendar event string."
1362 (with-temp-buffer
1363 (if (string-match "^BEGIN:VCALENDAR" input)
1364 (insert input)
1365 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1366 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1367 (insert input)
1368 (unless (eq (char-before) ?\n)
1369 (insert "\n"))
1370 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1371 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
1372 (icalendar-import-format-summary "%s")
1373 (icalendar-import-format-location "\n Location: %s")
1374 (icalendar-import-format-description "\n Desc: %s")
1375 (icalendar-import-format-organizer "\n Organizer: %s")
1376 (icalendar-import-format-status "\n Status: %s")
1377 (icalendar-import-format-url "\n URL: %s")
1378 (icalendar-import-format-class "\n Class: %s")
1379 (icalendar-import-format-class "\n UID: %s")
1380 (icalendar-export-alarms nil))
1381 (dolist (calendar-date-style '(iso european american))
1382 (icalendar-tests--do-test-cycle)))))
1384 (defun icalendar-tests--do-test-cycle ()
1385 "Actually perform import/export cycle test."
1386 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1387 (temp-ics (make-temp-file "icalendar-test-ics"))
1388 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1390 (unwind-protect
1391 (progn
1392 ;; step 1: import
1393 (icalendar-import-buffer temp-diary t t)
1395 ;; step 2: export what was just imported
1396 (save-excursion
1397 (find-file temp-diary)
1398 (icalendar-export-region (point-min) (point-max) temp-ics))
1400 ;; compare the output of step 2 with the input of step 1
1401 (save-excursion
1402 (find-file temp-ics)
1403 (goto-char (point-min))
1404 ;;(when (re-search-forward "\nUID:.*\n" nil t)
1405 ;;(replace-match "\n"))
1406 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1407 (should (string= org-input cycled)))))
1408 ;; clean up
1409 (kill-buffer (find-buffer-visiting temp-diary))
1410 (with-current-buffer (find-buffer-visiting temp-ics)
1411 (set-buffer-modified-p nil)
1412 (kill-buffer (current-buffer)))
1413 (delete-file temp-diary)
1414 (delete-file temp-ics))))
1416 (ert-deftest icalendar-cycle ()
1417 "Perform cycling tests.
1418 Take care to avoid auto-generated UIDs here."
1419 (icalendar-tests--test-cycle
1420 "UID:dummyuid
1421 DTSTART;VALUE=DATE-TIME:20030919T090000
1422 DTEND;VALUE=DATE-TIME:20030919T113000
1423 SUMMARY:Cycletest
1425 (icalendar-tests--test-cycle
1426 "UID:blah
1427 DTSTART;VALUE=DATE-TIME:20030919T090000
1428 DTEND;VALUE=DATE-TIME:20030919T113000
1429 SUMMARY:Cycletest
1430 DESCRIPTION:beschreibung!
1431 LOCATION:nowhere
1432 ORGANIZER:ulf
1434 (icalendar-tests--test-cycle
1435 "UID:4711
1436 DTSTART;VALUE=DATE:19190909
1437 DTEND;VALUE=DATE:19190910
1438 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1439 SUMMARY:and diary-anniversary
1442 ;; ======================================================================
1443 ;; Real world
1444 ;; ======================================================================
1445 (ert-deftest icalendar-real-world ()
1446 "Perform real-world tests, as gathered from problem reports."
1447 ;; This is known to fail on MS-Windows, since it doesn't support DST
1448 ;; specification with month and day.
1449 :expected-result (if (memq system-type '(windows-nt ms-dos))
1450 :failed
1451 :passed)
1452 ;; 2003-05-29
1453 (icalendar-tests--test-import
1454 "BEGIN:VCALENDAR
1455 METHOD:REQUEST
1456 PRODID:Microsoft CDO for Microsoft Exchange
1457 VERSION:2.0
1458 BEGIN:VTIMEZONE
1459 TZID:Kolkata, Chennai, Mumbai, New Delhi
1460 X-MICROSOFT-CDO-TZID:23
1461 BEGIN:STANDARD
1462 DTSTART:16010101T000000
1463 TZOFFSETFROM:+0530
1464 TZOFFSETTO:+0530
1465 END:STANDARD
1466 BEGIN:DAYLIGHT
1467 DTSTART:16010101T000000
1468 TZOFFSETFROM:+0530
1469 TZOFFSETTO:+0530
1470 END:DAYLIGHT
1471 END:VTIMEZONE
1472 BEGIN:VEVENT
1473 DTSTAMP:20030509T043439Z
1474 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1475 SUMMARY:On-Site Interview
1476 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1477 010000000DB823520692542408ED02D7023F9DFF9
1478 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1479 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1480 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1481 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1482 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1483 zz\":MAILTO:zzzzzz@zzzzzzz.com
1484 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1485 LOCATION:Cccc
1486 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1487 DESCRIPTION:10:30am - Blah
1488 SEQUENCE:0
1489 PRIORITY:5
1490 CLASS:
1491 CREATED:20030509T043439Z
1492 LAST-MODIFIED:20030509T043459Z
1493 STATUS:CONFIRMED
1494 TRANSP:OPAQUE
1495 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1496 X-MICROSOFT-CDO-INSTTYPE:0
1497 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1498 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1499 X-MICROSOFT-CDO-IMPORTANCE:1
1500 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1501 BEGIN:VALARM
1502 ACTION:DISPLAY
1503 DESCRIPTION:REMINDER
1504 TRIGGER;RELATED=START:-PT00H15M00S
1505 END:VALARM
1506 END:VEVENT
1507 END:VCALENDAR"
1509 "&9/5/2003 07:00-12:00 On-Site Interview
1510 Desc: 10:30am - Blah
1511 Location: Cccc
1512 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1513 Status: CONFIRMED
1514 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1516 "&5/9/2003 07:00-12:00 On-Site Interview
1517 Desc: 10:30am - Blah
1518 Location: Cccc
1519 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1520 Status: CONFIRMED
1521 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1524 ;; created with http://apps.marudot.com/ical/
1525 (icalendar-tests--test-import
1526 "BEGIN:VCALENDAR
1527 VERSION:2.0
1528 PRODID:-//www.marudot.com//iCal Event Maker
1529 X-WR-CALNAME:Test
1530 CALSCALE:GREGORIAN
1531 BEGIN:VTIMEZONE
1532 TZID:Asia/Tehran
1533 TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran
1534 X-LIC-LOCATION:Asia/Tehran
1535 BEGIN:STANDARD
1536 TZOFFSETFROM:+0330
1537 TZOFFSETTO:+0330
1538 TZNAME:IRST
1539 DTSTART:19700101T000000
1540 END:STANDARD
1541 END:VTIMEZONE
1542 BEGIN:VEVENT
1543 DTSTAMP:20141116T171439Z
1544 UID:20141116T171439Z-678877132@marudot.com
1545 DTSTART;TZID=\"Asia/Tehran\":20141116T070000
1546 DTEND;TZID=\"Asia/Tehran\":20141116T080000
1547 SUMMARY:NoDST
1548 DESCRIPTION:Test event from timezone without DST
1549 LOCATION:Everywhere
1550 END:VEVENT
1551 END:VCALENDAR"
1553 "&16/11/2014 04:30-05:30 NoDST
1554 Desc: Test event from timezone without DST
1555 Location: Everywhere
1556 UID: 20141116T171439Z-678877132@marudot.com
1558 "&11/16/2014 04:30-05:30 NoDST
1559 Desc: Test event from timezone without DST
1560 Location: Everywhere
1561 UID: 20141116T171439Z-678877132@marudot.com
1565 ;; 2003-06-18 a
1566 (icalendar-tests--test-import
1567 "DTSTAMP:20030618T195512Z
1568 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1569 SUMMARY:Dress Rehearsal for XXXX-XXXX
1570 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1571 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1572 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1573 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1574 ORGANIZER;CN=\"ABCD,TECHTRAINING
1575 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1576 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1577 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1578 DESCRIPTION:753 Zeichen hier radiert
1579 SEQUENCE:0
1580 PRIORITY:5
1581 CLASS:
1582 CREATED:20030618T195518Z
1583 LAST-MODIFIED:20030618T195527Z
1584 STATUS:CONFIRMED
1585 TRANSP:OPAQUE
1586 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1587 X-MICROSOFT-CDO-INSTTYPE:0
1588 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1589 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1590 X-MICROSOFT-CDO-IMPORTANCE:1
1591 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1592 BEGIN:VALARM
1593 ACTION:DISPLAY
1594 DESCRIPTION:REMINDER
1595 TRIGGER;RELATED=START:-PT00H15M00S
1596 END:VALARM"
1598 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1599 Desc: 753 Zeichen hier radiert
1600 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1601 Organizer: MAILTO:xxx@xxxxx.com
1602 Status: CONFIRMED
1603 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1605 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1606 Desc: 753 Zeichen hier radiert
1607 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1608 Organizer: MAILTO:xxx@xxxxx.com
1609 Status: CONFIRMED
1610 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1612 ;; 2003-06-18 b -- uses timezone
1613 (icalendar-tests--test-import
1614 "BEGIN:VCALENDAR
1615 METHOD:REQUEST
1616 PRODID:Microsoft CDO for Microsoft Exchange
1617 VERSION:2.0
1618 BEGIN:VTIMEZONE
1619 TZID:Mountain Time (US & Canada)
1620 X-MICROSOFT-CDO-TZID:12
1621 BEGIN:STANDARD
1622 DTSTART:16010101T020000
1623 TZOFFSETFROM:-0600
1624 TZOFFSETTO:-0700
1625 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1626 END:STANDARD
1627 BEGIN:DAYLIGHT
1628 DTSTART:16010101T020000
1629 TZOFFSETFROM:-0700
1630 TZOFFSETTO:-0600
1631 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1632 END:DAYLIGHT
1633 END:VTIMEZONE
1634 BEGIN:VEVENT
1635 DTSTAMP:20030618T230323Z
1636 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1637 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1638 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1639 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1640 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1641 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1642 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1643 .com
1644 ORGANIZER;CN=\"ABCD,TECHTRAINING
1645 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1646 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1647 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1648 DESCRIPTION:Viele Zeichen standen hier früher
1649 SEQUENCE:0
1650 PRIORITY:5
1651 CLASS:
1652 CREATED:20030618T230326Z
1653 LAST-MODIFIED:20030618T230335Z
1654 STATUS:CONFIRMED
1655 TRANSP:OPAQUE
1656 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1657 X-MICROSOFT-CDO-INSTTYPE:0
1658 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1659 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1660 X-MICROSOFT-CDO-IMPORTANCE:1
1661 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1662 BEGIN:VALARM
1663 ACTION:DISPLAY
1664 DESCRIPTION:REMINDER
1665 TRIGGER;RELATED=START:-PT00H15M00S
1666 END:VALARM
1667 END:VEVENT
1668 END:VCALENDAR"
1670 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1671 Desc: Viele Zeichen standen hier früher
1672 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1673 Organizer: MAILTO:bbb@bbbbb.com
1674 Status: CONFIRMED
1675 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1677 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1678 Desc: Viele Zeichen standen hier früher
1679 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1680 Organizer: MAILTO:bbb@bbbbb.com
1681 Status: CONFIRMED
1682 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1684 ;; export 2004-10-28 block entries
1685 (icalendar-tests--test-export
1688 "-*- mode: text; fill-column: 256;-*-
1690 >>> block entries:
1692 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1694 "DTSTART;VALUE=DATE:20041108
1695 DTEND;VALUE=DATE:20041111
1696 SUMMARY:Nov 8-10 aa")
1698 (icalendar-tests--test-export
1701 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1702 "DTSTART;VALUE=DATE:20041213
1703 DTEND;VALUE=DATE:20041218
1704 SUMMARY:Dec 13-17 bb")
1706 (icalendar-tests--test-export
1709 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1710 "DTSTART;VALUE=DATE:20050203
1711 DTEND;VALUE=DATE:20050205
1712 SUMMARY:Feb 3-4 cc")
1714 (icalendar-tests--test-export
1717 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1718 "DTSTART;VALUE=DATE:20050424
1719 DTEND;VALUE=DATE:20050430
1720 SUMMARY:April 24-29 dd
1722 (icalendar-tests--test-export
1725 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1726 "DTSTART;VALUE=DATE:20050530
1727 DTEND;VALUE=DATE:20050602
1728 SUMMARY:may 30 - June 1: ee")
1730 (icalendar-tests--test-export
1733 "%%(diary-block 6 6 2005 6 8 2005) ff"
1734 "DTSTART;VALUE=DATE:20050606
1735 DTEND;VALUE=DATE:20050609
1736 SUMMARY:ff")
1738 ;; export 2004-10-28 anniversary entries
1739 (icalendar-tests--test-export
1743 >>> anniversaries:
1745 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1746 "DTSTART;VALUE=DATE:19910328
1747 DTEND;VALUE=DATE:19910329
1748 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1749 SUMMARY:aa birthday (%d years old)
1752 (icalendar-tests--test-export
1755 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1756 "DTSTART;VALUE=DATE:19570517
1757 DTEND;VALUE=DATE:19570518
1758 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1759 SUMMARY:bb birthday (%d years old)")
1761 (icalendar-tests--test-export
1764 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1765 "DTSTART;VALUE=DATE:19970608
1766 DTEND;VALUE=DATE:19970609
1767 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1768 SUMMARY:cc birthday (%d years old)")
1770 (icalendar-tests--test-export
1773 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1774 "DTSTART;VALUE=DATE:19830722
1775 DTEND;VALUE=DATE:19830723
1776 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1777 SUMMARY:dd (%d years ago...!)")
1779 (icalendar-tests--test-export
1782 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1783 "DTSTART;VALUE=DATE:19880801
1784 DTEND;VALUE=DATE:19880802
1785 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1786 SUMMARY:ee birthday (%d years old)")
1788 (icalendar-tests--test-export
1791 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1792 "DTSTART;VALUE=DATE:19570921
1793 DTEND;VALUE=DATE:19570922
1794 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1795 SUMMARY:ff birthday (%d years old)")
1798 ;; FIXME!
1800 ;; export 2004-10-28 monthly, weekly entries
1802 ;; (icalendar-tests--test-export
1803 ;; nil
1804 ;; "
1805 ;; >>> ------------ monthly:
1807 ;; */27/* 10:00 blah blah"
1808 ;; "xxx")
1810 (icalendar-tests--test-export
1813 ">>> ------------ my week:
1815 Monday 13:00 MAC"
1816 "DTSTART;VALUE=DATE-TIME:20000103T130000
1817 DTEND;VALUE=DATE-TIME:20000103T140000
1818 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1819 SUMMARY:MAC")
1821 (icalendar-tests--test-export
1824 "Monday 15:00 a1"
1825 "DTSTART;VALUE=DATE-TIME:20000103T150000
1826 DTEND;VALUE=DATE-TIME:20000103T160000
1827 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1828 SUMMARY:a1")
1831 (icalendar-tests--test-export
1834 "Monday 16:00-17:00 a2"
1835 "DTSTART;VALUE=DATE-TIME:20000103T160000
1836 DTEND;VALUE=DATE-TIME:20000103T170000
1837 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1838 SUMMARY:a2")
1840 (icalendar-tests--test-export
1843 "Tuesday 11:30-13:00 a3"
1844 "DTSTART;VALUE=DATE-TIME:20000104T113000
1845 DTEND;VALUE=DATE-TIME:20000104T130000
1846 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1847 SUMMARY:a3")
1849 (icalendar-tests--test-export
1852 "Tuesday 15:00 a4"
1853 "DTSTART;VALUE=DATE-TIME:20000104T150000
1854 DTEND;VALUE=DATE-TIME:20000104T160000
1855 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1856 SUMMARY:a4")
1858 (icalendar-tests--test-export
1861 "Wednesday 13:00 a5"
1862 "DTSTART;VALUE=DATE-TIME:20000105T130000
1863 DTEND;VALUE=DATE-TIME:20000105T140000
1864 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1865 SUMMARY:a5")
1867 (icalendar-tests--test-export
1870 "Wednesday 11:30-13:30 a6"
1871 "DTSTART;VALUE=DATE-TIME:20000105T113000
1872 DTEND;VALUE=DATE-TIME:20000105T133000
1873 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1874 SUMMARY:a6")
1876 (icalendar-tests--test-export
1879 "Wednesday 15:00 s1"
1880 "DTSTART;VALUE=DATE-TIME:20000105T150000
1881 DTEND;VALUE=DATE-TIME:20000105T160000
1882 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1883 SUMMARY:s1")
1886 ;; export 2004-10-28 regular entries
1887 (icalendar-tests--test-export
1891 >>> regular diary entries:
1893 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1894 "DTSTART;VALUE=DATE-TIME:20041012T140000
1895 DTEND;VALUE=DATE-TIME:20041012T150000
1896 SUMMARY:Tue: [2004-10-12] q1")
1898 ;; 2004-11-19
1899 (icalendar-tests--test-import
1900 "BEGIN:VCALENDAR
1901 VERSION
1902 :2.0
1903 PRODID
1904 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1905 BEGIN:VEVENT
1906 SUMMARY
1907 :Jjjjj & Wwwww
1908 STATUS
1909 :TENTATIVE
1910 CLASS
1911 :PRIVATE
1912 X-MOZILLA-ALARM-DEFAULT-LENGTH
1914 DTSTART
1915 :20041123T140000
1916 DTEND
1917 :20041123T143000
1918 DTSTAMP
1919 :20041118T013430Z
1920 LAST-MODIFIED
1921 :20041118T013640Z
1922 END:VEVENT
1923 BEGIN:VEVENT
1924 SUMMARY
1925 :BB Aaaaaaaa Bbbbb
1926 STATUS
1927 :TENTATIVE
1928 CLASS
1929 :PRIVATE
1930 X-MOZILLA-ALARM-DEFAULT-LENGTH
1932 DTSTART
1933 :20041123T144500
1934 DTEND
1935 :20041123T154500
1936 DTSTAMP
1937 :20041118T013641Z
1938 END:VEVENT
1939 BEGIN:VEVENT
1940 SUMMARY
1941 :Hhhhhhhh
1942 STATUS
1943 :TENTATIVE
1944 CLASS
1945 :PRIVATE
1946 X-MOZILLA-ALARM-DEFAULT-LENGTH
1948 DTSTART
1949 :20041123T110000
1950 DTEND
1951 :20041123T120000
1952 DTSTAMP
1953 :20041118T013831Z
1954 END:VEVENT
1955 BEGIN:VEVENT
1956 SUMMARY
1957 :MMM Aaaaaaaaa
1958 STATUS
1959 :TENTATIVE
1960 CLASS
1961 :PRIVATE
1962 X-MOZILLA-ALARM-DEFAULT-LENGTH
1964 X-MOZILLA-RECUR-DEFAULT-INTERVAL
1966 RRULE
1967 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
1968 DTSTART
1969 :20041112T140000
1970 DTEND
1971 :20041112T183000
1972 DTSTAMP
1973 :20041118T014117Z
1974 END:VEVENT
1975 BEGIN:VEVENT
1976 SUMMARY
1977 :Rrrr/Cccccc ii Aaaaaaaa
1978 DESCRIPTION
1979 :Vvvvv Rrrr aaa Cccccc
1980 STATUS
1981 :TENTATIVE
1982 CLASS
1983 :PRIVATE
1984 X-MOZILLA-ALARM-DEFAULT-LENGTH
1986 DTSTART
1987 ;VALUE=DATE
1988 :20041119
1989 DTEND
1990 ;VALUE=DATE
1991 :20041120
1992 DTSTAMP
1993 :20041118T013107Z
1994 LAST-MODIFIED
1995 :20041118T014203Z
1996 END:VEVENT
1997 BEGIN:VEVENT
1998 SUMMARY
1999 :Wwww aa hhhh
2000 STATUS
2001 :TENTATIVE
2002 CLASS
2003 :PRIVATE
2004 X-MOZILLA-ALARM-DEFAULT-LENGTH
2006 RRULE
2007 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
2008 DTSTART
2009 ;VALUE=DATE
2010 :20041101
2011 DTEND
2012 ;VALUE=DATE
2013 :20041102
2014 DTSTAMP
2015 :20041118T014045Z
2016 LAST-MODIFIED
2017 :20041118T023846Z
2018 END:VEVENT
2019 END:VCALENDAR
2022 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
2023 Status: TENTATIVE
2024 Class: PRIVATE
2025 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
2026 Status: TENTATIVE
2027 Class: PRIVATE
2028 &23/11/2004 11:00-12:00 Hhhhhhhh
2029 Status: TENTATIVE
2030 Class: PRIVATE
2031 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
2032 Status: TENTATIVE
2033 Class: PRIVATE
2034 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
2035 Desc: Vvvvv Rrrr aaa Cccccc
2036 Status: TENTATIVE
2037 Class: PRIVATE
2038 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
2039 Status: TENTATIVE
2040 Class: PRIVATE
2042 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
2043 Status: TENTATIVE
2044 Class: PRIVATE
2045 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
2046 Status: TENTATIVE
2047 Class: PRIVATE
2048 &11/23/2004 11:00-12:00 Hhhhhhhh
2049 Status: TENTATIVE
2050 Class: PRIVATE
2051 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
2052 Status: TENTATIVE
2053 Class: PRIVATE
2054 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
2055 Desc: Vvvvv Rrrr aaa Cccccc
2056 Status: TENTATIVE
2057 Class: PRIVATE
2058 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
2059 Status: TENTATIVE
2060 Class: PRIVATE
2063 ;; 2004-09-09 pg
2064 (icalendar-tests--test-export
2065 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
2068 "DTSTART;VALUE=DATE:20040101
2069 DTEND;VALUE=DATE:20040105
2070 SUMMARY:Urlaub")
2072 ;; 2004-10-25 pg
2073 (icalendar-tests--test-export
2075 "5 11 2004 Bla Fasel"
2077 "DTSTART;VALUE=DATE:20041105
2078 DTEND;VALUE=DATE:20041106
2079 SUMMARY:Bla Fasel")
2081 ;; 2004-10-30 pg
2082 (icalendar-tests--test-export
2084 "2 Nov 2004 15:00-16:30 Zahnarzt"
2086 "DTSTART;VALUE=DATE-TIME:20041102T150000
2087 DTEND;VALUE=DATE-TIME:20041102T163000
2088 SUMMARY:Zahnarzt")
2090 ;; 2005-02-07 lt
2091 (icalendar-tests--test-import
2092 "UID
2093 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
2094 SUMMARY
2095 :Waitangi Day
2096 DESCRIPTION
2097 :abcdef
2098 CATEGORIES
2099 :Public Holiday
2100 STATUS
2101 :CONFIRMED
2102 CLASS
2103 :PRIVATE
2104 DTSTART
2105 ;VALUE=DATE
2106 :20050206
2107 DTEND
2108 ;VALUE=DATE
2109 :20050207
2110 DTSTAMP
2111 :20050128T011209Z"
2113 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
2114 Desc: abcdef
2115 Status: CONFIRMED
2116 Class: PRIVATE
2117 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
2119 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
2120 Desc: abcdef
2121 Status: CONFIRMED
2122 Class: PRIVATE
2123 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
2126 ;; 2005-03-01 lt
2127 (icalendar-tests--test-import
2128 "DTSTART;VALUE=DATE:20050217
2129 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
2130 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
2131 DTSTAMP:20050118T210335Z
2132 DURATION:P7D"
2134 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
2135 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n"
2136 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
2137 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n")
2139 ;; 2005-03-23 lt
2140 (icalendar-tests--test-export
2142 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
2144 "DTSTART;VALUE=DATE-TIME:20050208T160000
2145 DTEND;VALUE=DATE-TIME:20050208T164500
2146 RRULE:FREQ=DAILY;INTERVAL=7
2147 SUMMARY:[WORK] Pppp
2150 ;; 2005-05-27 eu
2151 (icalendar-tests--test-export
2154 ;; FIXME: colon not allowed!
2155 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
2156 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
2157 "DTSTART;VALUE=DATE:19001101
2158 DTEND;VALUE=DATE:19001102
2159 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
2160 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
2163 ;; bug#11473
2164 (icalendar-tests--test-import
2165 "BEGIN:VCALENDAR
2166 METHOD:REQUEST
2167 PRODID:Microsoft Exchange Server 2007
2168 VERSION:2.0
2169 BEGIN:VTIMEZONE
2170 TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
2171 BEGIN:STANDARD
2172 DTSTART:16010101T030000
2173 TZOFFSETFROM:+0200
2174 TZOFFSETTO:+0100
2175 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
2176 END:STANDARD
2177 BEGIN:DAYLIGHT
2178 DTSTART:16010101T020000
2179 TZOFFSETFROM:+0100
2180 TZOFFSETTO:+0200
2181 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
2182 END:DAYLIGHT
2183 END:VTIMEZONE
2184 BEGIN:VEVENT
2185 ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com
2186 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth
2187 er\":MAILTO:other.luser@foo.com
2188 DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n
2189 SUMMARY;LANGUAGE=en-US:Query
2190 DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\"
2191 :20120515T150000
2192 DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2
2193 0120515T153000
2194 UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000
2195 010000000575268034ECDB649A15349B1BF240F15
2196 RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V
2197 ienna\":20120515T170000
2198 CLASS:PUBLIC
2199 PRIORITY:5
2200 DTSTAMP:20120514T153645Z
2201 TRANSP:OPAQUE
2202 STATUS:CONFIRMED
2203 SEQUENCE:15
2204 LOCATION;LANGUAGE=en-US:phone
2205 X-MICROSOFT-CDO-APPT-SEQUENCE:15
2206 X-MICROSOFT-CDO-OWNERAPPTID:1907632092
2207 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
2208 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
2209 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
2210 X-MICROSOFT-CDO-IMPORTANCE:1
2211 X-MICROSOFT-CDO-INSTTYPE:3
2212 BEGIN:VALARM
2213 ACTION:DISPLAY
2214 DESCRIPTION:REMINDER
2215 TRIGGER;RELATED=START:-PT15M
2216 END:VALARM
2217 END:VEVENT
2218 END:VCALENDAR"
2220 "&15/5/2012 15:00-15:30 Query
2221 Location: phone
2222 Organizer: MAILTO:a.luser@foo.com
2223 Status: CONFIRMED
2224 Class: PUBLIC
2225 UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15
2226 " nil)
2228 ;; 2015-12-05, mixed line endings and empty lines, see Bug#22092.
2229 (icalendar-tests--test-import
2230 "BEGIN:VCALENDAR\r
2231 PRODID:-//www.norwegian.no//iCalendar MIMEDIR//EN\r
2232 VERSION:2.0\r
2233 METHOD:REQUEST\r
2234 BEGIN:VEVENT\r
2235 UID:RFCALITEM1\r
2236 SEQUENCE:1512040950\r
2237 DTSTAMP:20141204T095043Z\r
2238 ORGANIZER:noreply@norwegian.no\r
2239 DTSTART:20141208T173000Z\r
2241 DTEND:20141208T215500Z\r
2243 LOCATION:Stavanger-Sola\r
2245 DESCRIPTION:Fly med Norwegian, reservasjon. Fra Stavanger til Troms&#248; 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Troms&#248; 8. des 2014 21:00, DY390\r
2247 X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\"><html><head><META NAME=\"Generator\" CONTENT=\"MS Exchange Server version 08.00.0681.000\"><title></title></head><body><b><font face=\"Calibri\" size=\"3\">Reisereferanse</p></body></html>
2248 SUMMARY:Norwegian til Tromsoe-Langnes -\r
2250 CATEGORIES:Appointment\r
2253 PRIORITY:5\r
2255 CLASS:PUBLIC\r
2257 TRANSP:OPAQUE\r
2258 END:VEVENT\r
2259 END:VCALENDAR
2261 "&2014/12/8 18:30-22:55 Norwegian til Tromsoe-Langnes -
2262 Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Troms&#248; 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Troms&#248; 8. des 2014 21:00, DY390
2263 Location: Stavanger-Sola
2264 Organizer: noreply@norwegian.no
2265 Class: PUBLIC
2266 UID: RFCALITEM1
2268 "&8/12/2014 18:30-22:55 Norwegian til Tromsoe-Langnes -
2269 Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Troms&#248; 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Troms&#248; 8. des 2014 21:00, DY390
2270 Location: Stavanger-Sola
2271 Organizer: noreply@norwegian.no
2272 Class: PUBLIC
2273 UID: RFCALITEM1
2275 "&12/8/2014 18:30-22:55 Norwegian til Tromsoe-Langnes -
2276 Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Troms&#248; 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Troms&#248; 8. des 2014 21:00, DY390
2277 Location: Stavanger-Sola
2278 Organizer: noreply@norwegian.no
2279 Class: PUBLIC
2280 UID: RFCALITEM1
2285 (provide 'icalendar-tests)
2286 ;;; icalendar-tests.el ends here