Fix Bug#24199.
[emacs.git] / test / lisp / calendar / icalendar-tests.el
blob307d687f2afdf1f844255da652796b3af31e5a3a
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-bug-24199 ()
1261 ;;bug#24199 -- monthly rule with byday-clause
1262 (icalendar-tests--test-import
1264 SUMMARY:Summary
1265 DESCRIPTION:Desc
1266 LOCATION:Loc
1267 DTSTART:20151202T124600
1268 DTEND:20151202T160000
1269 RRULE:FREQ=MONTHLY;BYDAY=1WE;INTERVAL=1
1270 EXDATE:20160106T114600Z
1271 EXDATE:20160203T114600Z
1272 EXDATE:20160302T114600Z
1273 EXDATE:20160504T104600Z
1274 EXDATE:20160601T104600Z
1275 CLASS:DEFAULT
1276 TRANSP:OPAQUE
1277 BEGIN:VALARM
1278 ACTION:DISPLAY
1279 TRIGGER;VALUE=DURATION:-PT3H
1280 END:VALARM
1281 LAST-MODIFIED:20160805T191040Z
1282 UID:9188710a-08a7-4061-bae3-d4cf4972599a
1284 "&%%(and (not (diary-date 2016 1 6)) (not (diary-date 2016 2 3)) (not (diary-date 2016 3 2)) (not (diary-date 2016 5 4)) (not (diary-date 2016 6 1)) (diary-float t 3 1) (diary-block 2015 12 2 9999 1 1)) 12:46-16:00 Summary
1285 Desc: Desc
1286 Location: Loc
1287 Class: DEFAULT
1288 UID: 9188710a-08a7-4061-bae3-d4cf4972599a
1290 "&%%(and (not (diary-date 6 1 2016)) (not (diary-date 3 2 2016)) (not (diary-date 2 3 2016)) (not (diary-date 4 5 2016)) (not (diary-date 1 6 2016)) (diary-float t 3 1) (diary-block 2 12 2015 1 1 9999)) 12:46-16:00 Summary
1291 Desc: Desc
1292 Location: Loc
1293 Class: DEFAULT
1294 UID: 9188710a-08a7-4061-bae3-d4cf4972599a
1296 "&%%(and (not (diary-date 1 6 2016)) (not (diary-date 2 3 2016)) (not (diary-date 3 2 2016)) (not (diary-date 5 4 2016)) (not (diary-date 6 1 2016)) (diary-float t 3 1) (diary-block 12 2 2015 1 1 9999)) 12:46-16:00 Summary
1297 Desc: Desc
1298 Location: Loc
1299 Class: DEFAULT
1300 UID: 9188710a-08a7-4061-bae3-d4cf4972599a
1304 (ert-deftest icalendar-import-multiple-vcalendars ()
1305 (icalendar-tests--test-import
1306 "DTSTART;VALUE=DATE:20110723
1307 SUMMARY:event-1
1309 "&2011/7/23 event-1\n"
1310 "&23/7/2011 event-1\n"
1311 "&7/23/2011 event-1\n")
1313 (icalendar-tests--test-import
1314 "BEGIN:VCALENDAR
1315 PRODID:-//Emacs//NONSGML icalendar.el//EN
1316 VERSION:2.0\nBEGIN:VEVENT
1317 DTSTART;VALUE=DATE:20110723
1318 SUMMARY:event-1
1319 END:VEVENT
1320 END:VCALENDAR
1321 BEGIN:VCALENDAR
1322 PRODID:-//Emacs//NONSGML icalendar.el//EN
1323 VERSION:2.0
1324 BEGIN:VEVENT
1325 DTSTART;VALUE=DATE:20110724
1326 SUMMARY:event-2
1327 END:VEVENT
1328 END:VCALENDAR
1329 BEGIN:VCALENDAR
1330 PRODID:-//Emacs//NONSGML icalendar.el//EN
1331 VERSION:2.0
1332 BEGIN:VEVENT
1333 DTSTART;VALUE=DATE:20110725
1334 SUMMARY:event-3a
1335 END:VEVENT
1336 BEGIN:VEVENT
1337 DTSTART;VALUE=DATE:20110725
1338 SUMMARY:event-3b
1339 END:VEVENT
1340 END:VCALENDAR
1342 "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n"
1343 "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n"
1344 "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n"))
1346 (ert-deftest icalendar-import-with-uid ()
1347 "Perform import test with uid."
1348 (icalendar-tests--test-import
1349 "UID:1234567890uid
1350 SUMMARY:non-recurring
1351 DTSTART;VALUE=DATE-TIME:20030919T090000
1352 DTEND;VALUE=DATE-TIME:20030919T113000"
1353 "&2003/9/19 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1354 "&19/9/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"
1355 "&9/19/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n"))
1357 (ert-deftest icalendar-import-with-timezone ()
1358 ;; This is known to fail on MS-Windows, because the test assumes
1359 ;; Posix features of specifying DST rules.
1360 :expected-result (if (memq system-type '(windows-nt ms-dos))
1361 :failed
1362 :passed)
1363 ;; bug#11473
1364 (icalendar-tests--test-import
1365 "BEGIN:VCALENDAR
1366 BEGIN:VTIMEZONE
1367 TZID:fictional, nonexistent, arbitrary
1368 BEGIN:STANDARD
1369 DTSTART:20100101T000000
1370 TZOFFSETFROM:+0200
1371 TZOFFSETTO:-0200
1372 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01
1373 END:STANDARD
1374 BEGIN:DAYLIGHT
1375 DTSTART:20101201T000000
1376 TZOFFSETFROM:-0200
1377 TZOFFSETTO:+0200
1378 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
1379 END:DAYLIGHT
1380 END:VTIMEZONE
1381 BEGIN:VEVENT
1382 SUMMARY:standardtime
1383 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000
1384 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000
1385 END:VEVENT
1386 BEGIN:VEVENT
1387 SUMMARY:daylightsavingtime
1388 DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000
1389 DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000
1390 END:VEVENT
1391 END:VCALENDAR"
1392 ;; "standardtime" begins first sunday in january and is 4 hours behind CET
1393 ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET
1394 "&2012/1/15 15:00-15:30 standardtime
1395 &2012/12/15 11:00-11:30 daylightsavingtime
1398 nil)
1400 ;; ======================================================================
1401 ;; Cycle
1402 ;; ======================================================================
1403 (defun icalendar-tests--test-cycle (input)
1404 "Perform cycle test.
1405 Argument INPUT icalendar event string."
1406 (with-temp-buffer
1407 (if (string-match "^BEGIN:VCALENDAR" input)
1408 (insert input)
1409 (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n")
1410 (insert "VERSION:2.0\nBEGIN:VEVENT\n")
1411 (insert input)
1412 (unless (eq (char-before) ?\n)
1413 (insert "\n"))
1414 (insert "END:VEVENT\nEND:VCALENDAR\n"))
1415 (let ((icalendar-import-format "%s%d%l%o%t%u%c%U")
1416 (icalendar-import-format-summary "%s")
1417 (icalendar-import-format-location "\n Location: %s")
1418 (icalendar-import-format-description "\n Desc: %s")
1419 (icalendar-import-format-organizer "\n Organizer: %s")
1420 (icalendar-import-format-status "\n Status: %s")
1421 (icalendar-import-format-url "\n URL: %s")
1422 (icalendar-import-format-class "\n Class: %s")
1423 (icalendar-import-format-class "\n UID: %s")
1424 (icalendar-export-alarms nil))
1425 (dolist (calendar-date-style '(iso european american))
1426 (icalendar-tests--do-test-cycle)))))
1428 (defun icalendar-tests--do-test-cycle ()
1429 "Actually perform import/export cycle test."
1430 (let ((temp-diary (make-temp-file "icalendar-test-diary"))
1431 (temp-ics (make-temp-file "icalendar-test-ics"))
1432 (org-input (buffer-substring-no-properties (point-min) (point-max))))
1434 (unwind-protect
1435 (progn
1436 ;; step 1: import
1437 (icalendar-import-buffer temp-diary t t)
1439 ;; step 2: export what was just imported
1440 (save-excursion
1441 (find-file temp-diary)
1442 (icalendar-export-region (point-min) (point-max) temp-ics))
1444 ;; compare the output of step 2 with the input of step 1
1445 (save-excursion
1446 (find-file temp-ics)
1447 (goto-char (point-min))
1448 ;;(when (re-search-forward "\nUID:.*\n" nil t)
1449 ;;(replace-match "\n"))
1450 (let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
1451 (should (string= org-input cycled)))))
1452 ;; clean up
1453 (kill-buffer (find-buffer-visiting temp-diary))
1454 (with-current-buffer (find-buffer-visiting temp-ics)
1455 (set-buffer-modified-p nil)
1456 (kill-buffer (current-buffer)))
1457 (delete-file temp-diary)
1458 (delete-file temp-ics))))
1460 (ert-deftest icalendar-cycle ()
1461 "Perform cycling tests.
1462 Take care to avoid auto-generated UIDs here."
1463 (icalendar-tests--test-cycle
1464 "UID:dummyuid
1465 DTSTART;VALUE=DATE-TIME:20030919T090000
1466 DTEND;VALUE=DATE-TIME:20030919T113000
1467 SUMMARY:Cycletest
1469 (icalendar-tests--test-cycle
1470 "UID:blah
1471 DTSTART;VALUE=DATE-TIME:20030919T090000
1472 DTEND;VALUE=DATE-TIME:20030919T113000
1473 SUMMARY:Cycletest
1474 DESCRIPTION:beschreibung!
1475 LOCATION:nowhere
1476 ORGANIZER:ulf
1478 (icalendar-tests--test-cycle
1479 "UID:4711
1480 DTSTART;VALUE=DATE:19190909
1481 DTEND;VALUE=DATE:19190910
1482 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
1483 SUMMARY:and diary-anniversary
1486 ;; ======================================================================
1487 ;; Real world
1488 ;; ======================================================================
1489 (ert-deftest icalendar-real-world ()
1490 "Perform real-world tests, as gathered from problem reports."
1491 ;; This is known to fail on MS-Windows, since it doesn't support DST
1492 ;; specification with month and day.
1493 :expected-result (if (memq system-type '(windows-nt ms-dos))
1494 :failed
1495 :passed)
1496 ;; 2003-05-29
1497 (icalendar-tests--test-import
1498 "BEGIN:VCALENDAR
1499 METHOD:REQUEST
1500 PRODID:Microsoft CDO for Microsoft Exchange
1501 VERSION:2.0
1502 BEGIN:VTIMEZONE
1503 TZID:Kolkata, Chennai, Mumbai, New Delhi
1504 X-MICROSOFT-CDO-TZID:23
1505 BEGIN:STANDARD
1506 DTSTART:16010101T000000
1507 TZOFFSETFROM:+0530
1508 TZOFFSETTO:+0530
1509 END:STANDARD
1510 BEGIN:DAYLIGHT
1511 DTSTART:16010101T000000
1512 TZOFFSETFROM:+0530
1513 TZOFFSETTO:+0530
1514 END:DAYLIGHT
1515 END:VTIMEZONE
1516 BEGIN:VEVENT
1517 DTSTAMP:20030509T043439Z
1518 DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000
1519 SUMMARY:On-Site Interview
1520 UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000
1521 010000000DB823520692542408ED02D7023F9DFF9
1522 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx
1523 xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com
1524 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y
1525 yyyy\":MAILTO:yyyyyyy@yyyyyyy.com
1526 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz
1527 zz\":MAILTO:zzzzzz@zzzzzzz.com
1528 ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com
1529 LOCATION:Cccc
1530 DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000
1531 DESCRIPTION:10:30am - Blah
1532 SEQUENCE:0
1533 PRIORITY:5
1534 CLASS:
1535 CREATED:20030509T043439Z
1536 LAST-MODIFIED:20030509T043459Z
1537 STATUS:CONFIRMED
1538 TRANSP:OPAQUE
1539 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1540 X-MICROSOFT-CDO-INSTTYPE:0
1541 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1542 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1543 X-MICROSOFT-CDO-IMPORTANCE:1
1544 X-MICROSOFT-CDO-OWNERAPPTID:126441427
1545 BEGIN:VALARM
1546 ACTION:DISPLAY
1547 DESCRIPTION:REMINDER
1548 TRIGGER;RELATED=START:-PT00H15M00S
1549 END:VALARM
1550 END:VEVENT
1551 END:VCALENDAR"
1553 "&9/5/2003 07:00-12:00 On-Site Interview
1554 Desc: 10:30am - Blah
1555 Location: Cccc
1556 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1557 Status: CONFIRMED
1558 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1560 "&5/9/2003 07:00-12:00 On-Site Interview
1561 Desc: 10:30am - Blah
1562 Location: Cccc
1563 Organizer: MAILTO:aaaaaaa@aaaaaaa.com
1564 Status: CONFIRMED
1565 UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9
1568 ;; created with http://apps.marudot.com/ical/
1569 (icalendar-tests--test-import
1570 "BEGIN:VCALENDAR
1571 VERSION:2.0
1572 PRODID:-//www.marudot.com//iCal Event Maker
1573 X-WR-CALNAME:Test
1574 CALSCALE:GREGORIAN
1575 BEGIN:VTIMEZONE
1576 TZID:Asia/Tehran
1577 TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran
1578 X-LIC-LOCATION:Asia/Tehran
1579 BEGIN:STANDARD
1580 TZOFFSETFROM:+0330
1581 TZOFFSETTO:+0330
1582 TZNAME:IRST
1583 DTSTART:19700101T000000
1584 END:STANDARD
1585 END:VTIMEZONE
1586 BEGIN:VEVENT
1587 DTSTAMP:20141116T171439Z
1588 UID:20141116T171439Z-678877132@marudot.com
1589 DTSTART;TZID=\"Asia/Tehran\":20141116T070000
1590 DTEND;TZID=\"Asia/Tehran\":20141116T080000
1591 SUMMARY:NoDST
1592 DESCRIPTION:Test event from timezone without DST
1593 LOCATION:Everywhere
1594 END:VEVENT
1595 END:VCALENDAR"
1597 "&16/11/2014 04:30-05:30 NoDST
1598 Desc: Test event from timezone without DST
1599 Location: Everywhere
1600 UID: 20141116T171439Z-678877132@marudot.com
1602 "&11/16/2014 04:30-05:30 NoDST
1603 Desc: Test event from timezone without DST
1604 Location: Everywhere
1605 UID: 20141116T171439Z-678877132@marudot.com
1609 ;; 2003-06-18 a
1610 (icalendar-tests--test-import
1611 "DTSTAMP:20030618T195512Z
1612 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000
1613 SUMMARY:Dress Rehearsal for XXXX-XXXX
1614 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1615 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1616 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA
1617 AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com
1618 ORGANIZER;CN=\"ABCD,TECHTRAINING
1619 (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com
1620 LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below)
1621 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000
1622 DESCRIPTION:753 Zeichen hier radiert
1623 SEQUENCE:0
1624 PRIORITY:5
1625 CLASS:
1626 CREATED:20030618T195518Z
1627 LAST-MODIFIED:20030618T195527Z
1628 STATUS:CONFIRMED
1629 TRANSP:OPAQUE
1630 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1631 X-MICROSOFT-CDO-INSTTYPE:0
1632 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1633 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1634 X-MICROSOFT-CDO-IMPORTANCE:1
1635 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1636 BEGIN:VALARM
1637 ACTION:DISPLAY
1638 DESCRIPTION:REMINDER
1639 TRIGGER;RELATED=START:-PT00H15M00S
1640 END:VALARM"
1642 "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1643 Desc: 753 Zeichen hier radiert
1644 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1645 Organizer: MAILTO:xxx@xxxxx.com
1646 Status: CONFIRMED
1647 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1649 "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX
1650 Desc: 753 Zeichen hier radiert
1651 Location: 555 or TN 555-5555 ID 5555 & NochWas (see below)
1652 Organizer: MAILTO:xxx@xxxxx.com
1653 Status: CONFIRMED
1654 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1656 ;; 2003-06-18 b -- uses timezone
1657 (icalendar-tests--test-import
1658 "BEGIN:VCALENDAR
1659 METHOD:REQUEST
1660 PRODID:Microsoft CDO for Microsoft Exchange
1661 VERSION:2.0
1662 BEGIN:VTIMEZONE
1663 TZID:Mountain Time (US & Canada)
1664 X-MICROSOFT-CDO-TZID:12
1665 BEGIN:STANDARD
1666 DTSTART:16010101T020000
1667 TZOFFSETFROM:-0600
1668 TZOFFSETTO:-0700
1669 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
1670 END:STANDARD
1671 BEGIN:DAYLIGHT
1672 DTSTART:16010101T020000
1673 TZOFFSETFROM:-0700
1674 TZOFFSETTO:-0600
1675 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
1676 END:DAYLIGHT
1677 END:VTIMEZONE
1678 BEGIN:VEVENT
1679 DTSTAMP:20030618T230323Z
1680 DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000
1681 SUMMARY:Updated: Dress Rehearsal for ABC01-15
1682 UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000
1683 0100000007C3A6D65EE726E40B7F3D69A23BD567E
1684 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20
1685 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA
1686 \(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa
1687 .com
1688 ORGANIZER;CN=\"ABCD,TECHTRAINING
1689 \(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com
1690 LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below)
1691 DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000
1692 DESCRIPTION:Viele Zeichen standen hier früher
1693 SEQUENCE:0
1694 PRIORITY:5
1695 CLASS:
1696 CREATED:20030618T230326Z
1697 LAST-MODIFIED:20030618T230335Z
1698 STATUS:CONFIRMED
1699 TRANSP:OPAQUE
1700 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
1701 X-MICROSOFT-CDO-INSTTYPE:0
1702 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
1703 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
1704 X-MICROSOFT-CDO-IMPORTANCE:1
1705 X-MICROSOFT-CDO-OWNERAPPTID:1022519251
1706 BEGIN:VALARM
1707 ACTION:DISPLAY
1708 DESCRIPTION:REMINDER
1709 TRIGGER;RELATED=START:-PT00H15M00S
1710 END:VALARM
1711 END:VEVENT
1712 END:VCALENDAR"
1714 "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1715 Desc: Viele Zeichen standen hier früher
1716 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1717 Organizer: MAILTO:bbb@bbbbb.com
1718 Status: CONFIRMED
1719 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1721 "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15
1722 Desc: Viele Zeichen standen hier früher
1723 Location: 123 or TN 123-1234 ID abcd & SonstWo (see below)
1724 Organizer: MAILTO:bbb@bbbbb.com
1725 Status: CONFIRMED
1726 UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E
1728 ;; export 2004-10-28 block entries
1729 (icalendar-tests--test-export
1732 "-*- mode: text; fill-column: 256;-*-
1734 >>> block entries:
1736 %%(diary-block 11 8 2004 11 10 2004) Nov 8-10 aa
1738 "DTSTART;VALUE=DATE:20041108
1739 DTEND;VALUE=DATE:20041111
1740 SUMMARY:Nov 8-10 aa")
1742 (icalendar-tests--test-export
1745 "%%(diary-block 12 13 2004 12 17 2004) Dec 13-17 bb"
1746 "DTSTART;VALUE=DATE:20041213
1747 DTEND;VALUE=DATE:20041218
1748 SUMMARY:Dec 13-17 bb")
1750 (icalendar-tests--test-export
1753 "%%(diary-block 2 3 2005 2 4 2005) Feb 3-4 cc"
1754 "DTSTART;VALUE=DATE:20050203
1755 DTEND;VALUE=DATE:20050205
1756 SUMMARY:Feb 3-4 cc")
1758 (icalendar-tests--test-export
1761 "%%(diary-block 4 24 2005 4 29 2005) April 24-29 dd"
1762 "DTSTART;VALUE=DATE:20050424
1763 DTEND;VALUE=DATE:20050430
1764 SUMMARY:April 24-29 dd
1766 (icalendar-tests--test-export
1769 "%%(diary-block 5 30 2005 6 1 2005) may 30 - June 1: ee"
1770 "DTSTART;VALUE=DATE:20050530
1771 DTEND;VALUE=DATE:20050602
1772 SUMMARY:may 30 - June 1: ee")
1774 (icalendar-tests--test-export
1777 "%%(diary-block 6 6 2005 6 8 2005) ff"
1778 "DTSTART;VALUE=DATE:20050606
1779 DTEND;VALUE=DATE:20050609
1780 SUMMARY:ff")
1782 ;; export 2004-10-28 anniversary entries
1783 (icalendar-tests--test-export
1787 >>> anniversaries:
1789 %%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
1790 "DTSTART;VALUE=DATE:19910328
1791 DTEND;VALUE=DATE:19910329
1792 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
1793 SUMMARY:aa birthday (%d years old)
1796 (icalendar-tests--test-export
1799 "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
1800 "DTSTART;VALUE=DATE:19570517
1801 DTEND;VALUE=DATE:19570518
1802 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
1803 SUMMARY:bb birthday (%d years old)")
1805 (icalendar-tests--test-export
1808 "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
1809 "DTSTART;VALUE=DATE:19970608
1810 DTEND;VALUE=DATE:19970609
1811 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
1812 SUMMARY:cc birthday (%d years old)")
1814 (icalendar-tests--test-export
1817 "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
1818 "DTSTART;VALUE=DATE:19830722
1819 DTEND;VALUE=DATE:19830723
1820 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
1821 SUMMARY:dd (%d years ago...!)")
1823 (icalendar-tests--test-export
1826 "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
1827 "DTSTART;VALUE=DATE:19880801
1828 DTEND;VALUE=DATE:19880802
1829 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
1830 SUMMARY:ee birthday (%d years old)")
1832 (icalendar-tests--test-export
1835 "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
1836 "DTSTART;VALUE=DATE:19570921
1837 DTEND;VALUE=DATE:19570922
1838 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
1839 SUMMARY:ff birthday (%d years old)")
1842 ;; FIXME!
1844 ;; export 2004-10-28 monthly, weekly entries
1846 ;; (icalendar-tests--test-export
1847 ;; nil
1848 ;; "
1849 ;; >>> ------------ monthly:
1851 ;; */27/* 10:00 blah blah"
1852 ;; "xxx")
1854 (icalendar-tests--test-export
1857 ">>> ------------ my week:
1859 Monday 13:00 MAC"
1860 "DTSTART;VALUE=DATE-TIME:20000103T130000
1861 DTEND;VALUE=DATE-TIME:20000103T140000
1862 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1863 SUMMARY:MAC")
1865 (icalendar-tests--test-export
1868 "Monday 15:00 a1"
1869 "DTSTART;VALUE=DATE-TIME:20000103T150000
1870 DTEND;VALUE=DATE-TIME:20000103T160000
1871 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1872 SUMMARY:a1")
1875 (icalendar-tests--test-export
1878 "Monday 16:00-17:00 a2"
1879 "DTSTART;VALUE=DATE-TIME:20000103T160000
1880 DTEND;VALUE=DATE-TIME:20000103T170000
1881 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
1882 SUMMARY:a2")
1884 (icalendar-tests--test-export
1887 "Tuesday 11:30-13:00 a3"
1888 "DTSTART;VALUE=DATE-TIME:20000104T113000
1889 DTEND;VALUE=DATE-TIME:20000104T130000
1890 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1891 SUMMARY:a3")
1893 (icalendar-tests--test-export
1896 "Tuesday 15:00 a4"
1897 "DTSTART;VALUE=DATE-TIME:20000104T150000
1898 DTEND;VALUE=DATE-TIME:20000104T160000
1899 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU
1900 SUMMARY:a4")
1902 (icalendar-tests--test-export
1905 "Wednesday 13:00 a5"
1906 "DTSTART;VALUE=DATE-TIME:20000105T130000
1907 DTEND;VALUE=DATE-TIME:20000105T140000
1908 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1909 SUMMARY:a5")
1911 (icalendar-tests--test-export
1914 "Wednesday 11:30-13:30 a6"
1915 "DTSTART;VALUE=DATE-TIME:20000105T113000
1916 DTEND;VALUE=DATE-TIME:20000105T133000
1917 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1918 SUMMARY:a6")
1920 (icalendar-tests--test-export
1923 "Wednesday 15:00 s1"
1924 "DTSTART;VALUE=DATE-TIME:20000105T150000
1925 DTEND;VALUE=DATE-TIME:20000105T160000
1926 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
1927 SUMMARY:s1")
1930 ;; export 2004-10-28 regular entries
1931 (icalendar-tests--test-export
1935 >>> regular diary entries:
1937 Oct 12 2004, 14:00 Tue: [2004-10-12] q1"
1938 "DTSTART;VALUE=DATE-TIME:20041012T140000
1939 DTEND;VALUE=DATE-TIME:20041012T150000
1940 SUMMARY:Tue: [2004-10-12] q1")
1942 ;; 2004-11-19
1943 (icalendar-tests--test-import
1944 "BEGIN:VCALENDAR
1945 VERSION
1946 :2.0
1947 PRODID
1948 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
1949 BEGIN:VEVENT
1950 SUMMARY
1951 :Jjjjj & Wwwww
1952 STATUS
1953 :TENTATIVE
1954 CLASS
1955 :PRIVATE
1956 X-MOZILLA-ALARM-DEFAULT-LENGTH
1958 DTSTART
1959 :20041123T140000
1960 DTEND
1961 :20041123T143000
1962 DTSTAMP
1963 :20041118T013430Z
1964 LAST-MODIFIED
1965 :20041118T013640Z
1966 END:VEVENT
1967 BEGIN:VEVENT
1968 SUMMARY
1969 :BB Aaaaaaaa Bbbbb
1970 STATUS
1971 :TENTATIVE
1972 CLASS
1973 :PRIVATE
1974 X-MOZILLA-ALARM-DEFAULT-LENGTH
1976 DTSTART
1977 :20041123T144500
1978 DTEND
1979 :20041123T154500
1980 DTSTAMP
1981 :20041118T013641Z
1982 END:VEVENT
1983 BEGIN:VEVENT
1984 SUMMARY
1985 :Hhhhhhhh
1986 STATUS
1987 :TENTATIVE
1988 CLASS
1989 :PRIVATE
1990 X-MOZILLA-ALARM-DEFAULT-LENGTH
1992 DTSTART
1993 :20041123T110000
1994 DTEND
1995 :20041123T120000
1996 DTSTAMP
1997 :20041118T013831Z
1998 END:VEVENT
1999 BEGIN:VEVENT
2000 SUMMARY
2001 :MMM Aaaaaaaaa
2002 STATUS
2003 :TENTATIVE
2004 CLASS
2005 :PRIVATE
2006 X-MOZILLA-ALARM-DEFAULT-LENGTH
2008 X-MOZILLA-RECUR-DEFAULT-INTERVAL
2010 RRULE
2011 :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR
2012 DTSTART
2013 :20041112T140000
2014 DTEND
2015 :20041112T183000
2016 DTSTAMP
2017 :20041118T014117Z
2018 END:VEVENT
2019 BEGIN:VEVENT
2020 SUMMARY
2021 :Rrrr/Cccccc ii Aaaaaaaa
2022 DESCRIPTION
2023 :Vvvvv Rrrr aaa Cccccc
2024 STATUS
2025 :TENTATIVE
2026 CLASS
2027 :PRIVATE
2028 X-MOZILLA-ALARM-DEFAULT-LENGTH
2030 DTSTART
2031 ;VALUE=DATE
2032 :20041119
2033 DTEND
2034 ;VALUE=DATE
2035 :20041120
2036 DTSTAMP
2037 :20041118T013107Z
2038 LAST-MODIFIED
2039 :20041118T014203Z
2040 END:VEVENT
2041 BEGIN:VEVENT
2042 SUMMARY
2043 :Wwww aa hhhh
2044 STATUS
2045 :TENTATIVE
2046 CLASS
2047 :PRIVATE
2048 X-MOZILLA-ALARM-DEFAULT-LENGTH
2050 RRULE
2051 :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO
2052 DTSTART
2053 ;VALUE=DATE
2054 :20041101
2055 DTEND
2056 ;VALUE=DATE
2057 :20041102
2058 DTSTAMP
2059 :20041118T014045Z
2060 LAST-MODIFIED
2061 :20041118T023846Z
2062 END:VEVENT
2063 END:VCALENDAR
2066 "&23/11/2004 14:00-14:30 Jjjjj & Wwwww
2067 Status: TENTATIVE
2068 Class: PRIVATE
2069 &23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
2070 Status: TENTATIVE
2071 Class: PRIVATE
2072 &23/11/2004 11:00-12:00 Hhhhhhhh
2073 Status: TENTATIVE
2074 Class: PRIVATE
2075 &%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa
2076 Status: TENTATIVE
2077 Class: PRIVATE
2078 &%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa
2079 Desc: Vvvvv Rrrr aaa Cccccc
2080 Status: TENTATIVE
2081 Class: PRIVATE
2082 &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh
2083 Status: TENTATIVE
2084 Class: PRIVATE
2086 "&11/23/2004 14:00-14:30 Jjjjj & Wwwww
2087 Status: TENTATIVE
2088 Class: PRIVATE
2089 &11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb
2090 Status: TENTATIVE
2091 Class: PRIVATE
2092 &11/23/2004 11:00-12:00 Hhhhhhhh
2093 Status: TENTATIVE
2094 Class: PRIVATE
2095 &%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa
2096 Status: TENTATIVE
2097 Class: PRIVATE
2098 &%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa
2099 Desc: Vvvvv Rrrr aaa Cccccc
2100 Status: TENTATIVE
2101 Class: PRIVATE
2102 &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh
2103 Status: TENTATIVE
2104 Class: PRIVATE
2107 ;; 2004-09-09 pg
2108 (icalendar-tests--test-export
2109 "%%(diary-block 1 1 2004 4 1 2004) Urlaub"
2112 "DTSTART;VALUE=DATE:20040101
2113 DTEND;VALUE=DATE:20040105
2114 SUMMARY:Urlaub")
2116 ;; 2004-10-25 pg
2117 (icalendar-tests--test-export
2119 "5 11 2004 Bla Fasel"
2121 "DTSTART;VALUE=DATE:20041105
2122 DTEND;VALUE=DATE:20041106
2123 SUMMARY:Bla Fasel")
2125 ;; 2004-10-30 pg
2126 (icalendar-tests--test-export
2128 "2 Nov 2004 15:00-16:30 Zahnarzt"
2130 "DTSTART;VALUE=DATE-TIME:20041102T150000
2131 DTEND;VALUE=DATE-TIME:20041102T163000
2132 SUMMARY:Zahnarzt")
2134 ;; 2005-02-07 lt
2135 (icalendar-tests--test-import
2136 "UID
2137 :b60d398e-1dd1-11b2-a159-cf8cb05139f4
2138 SUMMARY
2139 :Waitangi Day
2140 DESCRIPTION
2141 :abcdef
2142 CATEGORIES
2143 :Public Holiday
2144 STATUS
2145 :CONFIRMED
2146 CLASS
2147 :PRIVATE
2148 DTSTART
2149 ;VALUE=DATE
2150 :20050206
2151 DTEND
2152 ;VALUE=DATE
2153 :20050207
2154 DTSTAMP
2155 :20050128T011209Z"
2157 "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day
2158 Desc: abcdef
2159 Status: CONFIRMED
2160 Class: PRIVATE
2161 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
2163 "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day
2164 Desc: abcdef
2165 Status: CONFIRMED
2166 Class: PRIVATE
2167 UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4
2170 ;; 2005-03-01 lt
2171 (icalendar-tests--test-import
2172 "DTSTART;VALUE=DATE:20050217
2173 SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa
2174 UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID
2175 DTSTAMP:20050118T210335Z
2176 DURATION:P7D"
2178 "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
2179 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n"
2180 "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa
2181 UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n")
2183 ;; 2005-03-23 lt
2184 (icalendar-tests--test-export
2186 "&%%(diary-cyclic 7 8 2 2005) 16:00-16:45 [WORK] Pppp"
2188 "DTSTART;VALUE=DATE-TIME:20050208T160000
2189 DTEND;VALUE=DATE-TIME:20050208T164500
2190 RRULE:FREQ=DAILY;INTERVAL=7
2191 SUMMARY:[WORK] Pppp
2194 ;; 2005-05-27 eu
2195 (icalendar-tests--test-export
2198 ;; FIXME: colon not allowed!
2199 ;;"Nov 1: NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
2200 "Nov 1 NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30"
2201 "DTSTART;VALUE=DATE:19001101
2202 DTEND;VALUE=DATE:19001102
2203 RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYMONTHDAY=1
2204 SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30
2207 ;; bug#11473
2208 (icalendar-tests--test-import
2209 "BEGIN:VCALENDAR
2210 METHOD:REQUEST
2211 PRODID:Microsoft Exchange Server 2007
2212 VERSION:2.0
2213 BEGIN:VTIMEZONE
2214 TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
2215 BEGIN:STANDARD
2216 DTSTART:16010101T030000
2217 TZOFFSETFROM:+0200
2218 TZOFFSETTO:+0100
2219 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
2220 END:STANDARD
2221 BEGIN:DAYLIGHT
2222 DTSTART:16010101T020000
2223 TZOFFSETFROM:+0100
2224 TZOFFSETTO:+0200
2225 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
2226 END:DAYLIGHT
2227 END:VTIMEZONE
2228 BEGIN:VEVENT
2229 ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com
2230 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth
2231 er\":MAILTO:other.luser@foo.com
2232 DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n
2233 SUMMARY;LANGUAGE=en-US:Query
2234 DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\"
2235 :20120515T150000
2236 DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2
2237 0120515T153000
2238 UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000
2239 010000000575268034ECDB649A15349B1BF240F15
2240 RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V
2241 ienna\":20120515T170000
2242 CLASS:PUBLIC
2243 PRIORITY:5
2244 DTSTAMP:20120514T153645Z
2245 TRANSP:OPAQUE
2246 STATUS:CONFIRMED
2247 SEQUENCE:15
2248 LOCATION;LANGUAGE=en-US:phone
2249 X-MICROSOFT-CDO-APPT-SEQUENCE:15
2250 X-MICROSOFT-CDO-OWNERAPPTID:1907632092
2251 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
2252 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
2253 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
2254 X-MICROSOFT-CDO-IMPORTANCE:1
2255 X-MICROSOFT-CDO-INSTTYPE:3
2256 BEGIN:VALARM
2257 ACTION:DISPLAY
2258 DESCRIPTION:REMINDER
2259 TRIGGER;RELATED=START:-PT15M
2260 END:VALARM
2261 END:VEVENT
2262 END:VCALENDAR"
2264 "&15/5/2012 15:00-15:30 Query
2265 Location: phone
2266 Organizer: MAILTO:a.luser@foo.com
2267 Status: CONFIRMED
2268 Class: PUBLIC
2269 UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15
2270 " nil)
2272 ;; 2015-12-05, mixed line endings and empty lines, see Bug#22092.
2273 (icalendar-tests--test-import
2274 "BEGIN:VCALENDAR\r
2275 PRODID:-//www.norwegian.no//iCalendar MIMEDIR//EN\r
2276 VERSION:2.0\r
2277 METHOD:REQUEST\r
2278 BEGIN:VEVENT\r
2279 UID:RFCALITEM1\r
2280 SEQUENCE:1512040950\r
2281 DTSTAMP:20141204T095043Z\r
2282 ORGANIZER:noreply@norwegian.no\r
2283 DTSTART:20141208T173000Z\r
2285 DTEND:20141208T215500Z\r
2287 LOCATION:Stavanger-Sola\r
2289 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
2291 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>
2292 SUMMARY:Norwegian til Tromsoe-Langnes -\r
2294 CATEGORIES:Appointment\r
2297 PRIORITY:5\r
2299 CLASS:PUBLIC\r
2301 TRANSP:OPAQUE\r
2302 END:VEVENT\r
2303 END:VCALENDAR
2305 "&2014/12/8 18:30-22:55 Norwegian til Tromsoe-Langnes -
2306 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
2307 Location: Stavanger-Sola
2308 Organizer: noreply@norwegian.no
2309 Class: PUBLIC
2310 UID: RFCALITEM1
2312 "&8/12/2014 18:30-22:55 Norwegian til Tromsoe-Langnes -
2313 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
2314 Location: Stavanger-Sola
2315 Organizer: noreply@norwegian.no
2316 Class: PUBLIC
2317 UID: RFCALITEM1
2319 "&12/8/2014 18:30-22:55 Norwegian til Tromsoe-Langnes -
2320 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
2321 Location: Stavanger-Sola
2322 Organizer: noreply@norwegian.no
2323 Class: PUBLIC
2324 UID: RFCALITEM1
2329 (provide 'icalendar-tests)
2330 ;;; icalendar-tests.el ends here