]>
diplodocus.org Git - nmh/blob - test/mhical/test-mhical
2 ######################################################
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"${MH_OBJ_DIR}/test/common.sh"
19 check_exit
'-eq 1' mhical
-
21 #### Make sure that html-to-text conversion is what we expect.
22 require_locale en_US.UTF
-8 en_US.UTF8 en_US.utf
-8 en_US.utf8
24 #### Disable colorized output.
25 TERM
=dumb
; export TERM
27 expected
="$MH_TEST_DIR/test-mhical$$.expected"
28 expected_err
="$MH_TEST_DIR/test-mhical$$.expected_err"
29 actual
="$MH_TEST_DIR/test-mhical$$.actual"
30 actual_err
="$MH_TEST_DIR/test-mhical$$.actual_err"
35 cat >"$expected" <<EOF
36 Usage: mhical [switches]
38 -reply accept|decline|tentative
52 #### Skip nmh intro text.
53 run_prog mhical
-help 2>&1 | sed '/^$/,$d' >"$actual"
54 check
"$expected" "$actual"
59 case `mhical -version` in
61 *) printf '%s: mhical -version generated unexpected output\n' "$0" >&2
62 failed
=`expr ${failed:-0} + 1`;;
66 # check display with timezone that only has standard time
67 start_test
"display with timezone that only has standard time"
68 cat >"$expected" <<'EOF'
70 Description: See Santa here first!
71 At: Wed, 24 Dec 2014 12:00 +0000
72 To: Fri, 25 Dec 2015 11:59
75 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
83 DTSTART:16010101T020000
90 DTSTAMP:20141224T140426Z
91 DTSTART;TZID=MHT-12:20141225T000000
92 DTEND;TZID=MHT-12:20151225T235959
94 DESCRIPTION: See Santa here first!
100 TZ
=UTC mhical
<"$MH_TEST_DIR/test1.ics" >"$MH_TEST_DIR/test1.txt"
101 check
"$expected" "$MH_TEST_DIR/test1.txt"
104 # check display with 24 hour time format and -outfile
105 start_test
"display with 24 hour time format and -outfile"
106 cat >"$expected" <<'EOF'
107 Summary: 4 pm meeting
108 At: Mon, 05 Jan 2015 16:00
109 To: Mon, 05 Jan 2015 16:30
112 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
118 DTSTAMP:20150101T162400Z
119 DTSTART:20150105T160000
120 DTEND:20150105T163000
127 mhical
-outfile "$MH_TEST_DIR/test1.txt" <"$MH_TEST_DIR/test1.ics"
128 check
"$expected" "$MH_TEST_DIR/test1.txt"
131 # check display with 12 hour time format and -infile
132 start_test
"display with 12 hour time format and -infile"
133 cat >"$expected" <<'EOF'
134 Summary: 4 pm meeting
135 At: Mon, 05 Jan 2015 4:00 PM
136 To: Mon, 05 Jan 2015 4:30 PM
139 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
145 DTSTAMP:20150101T162800Z
146 DTSTART:20150105T160000
147 DTEND:20150105T163000
154 mhical
-form mhical
.12hour
-infile "$MH_TEST_DIR/test1.ics" \
155 >"$MH_TEST_DIR/test1.txt"
156 check
"$expected" "$MH_TEST_DIR/test1.txt"
159 # check display with DST
160 start_test
"display with DST"
161 cat >"$expected" <<'EOF'
166 At: Mon, 05 Jan 2015 08:00 -0500
167 To: Mon, 05 Jan 2015 09:00
171 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
174 PRODID:Microsoft Exchange Server 2010
177 TZID:Eastern Standard Time
179 DTSTART:16010101T020000
182 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
185 DTSTART:16010101T020000
188 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
192 ORGANIZER;CN=Requester:MAILTO:requester@example.com
193 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=FALSE;CN=Requestee
194 :MAILTO:requestee@example.com
195 DESCRIPTION;LANGUAGE=en-US:\n\n
196 SUMMARY;LANGUAGE=en-US:Big Meeting
197 DTSTART;TZID=Eastern Standard Time:20150105T080000
198 DTEND;TZID=Eastern Standard Time:20150105T090000
202 DTSTAMP:20141231T235959Z
206 LOCATION;LANGUAGE=en-US:The Office
207 X-MICROSOFT-CDO-APPT-SEQUENCE:0
208 X-MICROSOFT-CDO-OWNERAPPTID:-0123456789
209 X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
210 X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
211 X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
212 X-MICROSOFT-CDO-IMPORTANCE:1
213 X-MICROSOFT-CDO-INSTTYPE:0
214 X-MICROSOFT-DISALLOW-COUNTER:FALSE
218 TRIGGER;RELATED=START:-PT15M
224 TZ
=EST mhical
<"$MH_TEST_DIR/test1.ics" >"$MH_TEST_DIR/test1.txt"
225 check
"$expected" "$MH_TEST_DIR/test1.txt"
228 # check timezone boundary at transition to daylight saving time
229 start_test
"timezone boundary at transition to daylight saving time"
230 # The default mhical display format doesn't show the timezone for the
231 # To: time, but it is different than that of the At: time.
232 cat >"$expected" <<'EOF'
234 At: Sun, 09 Mar 2014 01:59 -0500
235 To: Sun, 09 Mar 2014 03:30
238 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
243 TZID:Eastern Standard Time
245 DTSTART:16010101T020000
248 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
251 DTSTART:16010101T020000
254 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
258 DTSTAMP:20150101T000000Z
259 DTSTART;TZID=Eastern Standard Time:20140309T015959
260 DTEND;TZID=Eastern Standard Time:20140309T023000
266 TZ
=EST5EDT mhical
<"$MH_TEST_DIR/test1.ics" >"$MH_TEST_DIR/test1.txt"
267 check
"$expected" "$MH_TEST_DIR/test1.txt"
270 # check -format, and that timezone is correct in end time
271 start_test
"-format, and that timezone is correct in end time"
272 cat >"$expected" <<'EOF'
273 Sun, 09 Mar 2014 03:30:00 -0400
276 TZ
=EST5EDT mhical
-format '%(pretty{dtend})' \
277 -infile "$MH_TEST_DIR/test1.ics" -outfile "$MH_TEST_DIR/test1.txt"
278 check
"$expected" "$MH_TEST_DIR/test1.txt"
281 # check timezone boundary at transition from daylight saving time
282 start_test
"timezone boundary at transition from daylight saving time"
283 cat >"$expected" <<'EOF'
285 At: Sun, 02 Nov 2014 01:59 -0400
286 To: Sun, 02 Nov 2014 02:00
289 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
294 TZID:Eastern Standard Time
296 DTSTART:16010101T020000
299 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
302 DTSTART:16010101T020000
305 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
309 DTSTAMP:20150101T000000Z
310 DTSTART;TZID=Eastern Standard Time:20141102T015959
311 DTEND;TZID=Eastern Standard Time:20141102T020000
317 TZ
=EST5EDT mhical
<"$MH_TEST_DIR/test1.ics" >"$MH_TEST_DIR/test1.txt"
318 check
"$expected" "$MH_TEST_DIR/test1.txt"
321 # check -format, and that timezone is correct in end time
322 start_test
"-format, and that timezone is correct in end time"
323 cat >"$expected" <<'EOF'
324 Sun, 02 Nov 2014 02:00:00 -0500
327 TZ
=EST5EDT mhical
-format '%(pretty{dtend})' \
328 -infile "$MH_TEST_DIR/test1.ics" -outfile "$MH_TEST_DIR/test1.txt"
329 check
"$expected" "$MH_TEST_DIR/test1.txt"
332 printf 'Local-Mailbox: Requestee2 <requestee2@example.com>\n' >> "$MH"
334 # check accept of request
335 start_test
"accept of request"
336 cat >"$expected" <<'EOF'
339 PRODID:nmh mhical v0.5
342 TZID:Eastern Standard Time
344 DTSTART:16010101T020000
347 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
350 DTSTART:16010101T020000
353 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
357 ORGANIZER;CN=Requester:MAILTO:requester@example.com
358 ATTENDEE;PARTSTAT=ACCEPTED;CN=Requestee2:MAILTO:requestee2@example.com
359 SUMMARY;LANGUAGE=en-US:Accepted: test request
360 DTSTART;TZID=Eastern Standard Time:20150105T090000
361 DTEND;TZID=Eastern Standard Time:20150105T093000
368 LOCATION;LANGUAGE=en-US:
373 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
379 TZID:Eastern Standard Time
381 DTSTART:16010101T020000
384 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
387 DTSTART:16010101T020000
390 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
394 ORGANIZER;CN=Requester:MAILTO:requester@example.com
395 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
396 :MAILTO:requestee1@example.com
397 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
398 :MAILTO:requestee2@example.com
399 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
400 :MAILTO:requestee3@example.com
401 SUMMARY;LANGUAGE=en-US:test request
402 DTSTART;TZID=Eastern Standard Time:20150105T090000
403 DTEND;TZID=Eastern Standard Time:20150105T093000
407 DTSTAMP:20150101T171600Z
411 LOCATION;LANGUAGE=en-US:
415 TRIGGER;RELATED=START:-PT15M
421 mhical
-reply accept
<"$MH_TEST_DIR/test1.ics" | egrep -v '^DTSTAMP:' \
422 >"$MH_TEST_DIR/test1.txt"
423 check
"$expected" "$MH_TEST_DIR/test1.txt"
426 # check accept of request with -attendee
427 start_test
"accept of request with -attendee"
428 cat >"$expected" <<'EOF'
431 PRODID:nmh mhical v0.5
434 TZID:Eastern Standard Time
436 DTSTART:16010101T020000
439 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
442 DTSTART:16010101T020000
445 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
449 ORGANIZER;CN=Requester:MAILTO:requester@example.com
450 ATTENDEE;PARTSTAT=ACCEPTED;CN=Requestee1:MAILTO:requestee1@example.com
451 SUMMARY;LANGUAGE=en-US:Accepted: test request
452 DTSTART;TZID=Eastern Standard Time:20150105T090000
453 DTEND;TZID=Eastern Standard Time:20150105T093000
460 LOCATION;LANGUAGE=en-US:
465 cp "$MH" "${MH}.save"
466 printf 'Alternate-Mailboxes: RequesteeToo <requestee1@example.com>\n' >> "$MH"
467 mhical
-reply accept
-attendee requestee1@example.com
<"$MH_TEST_DIR/test1.ics" \
468 | egrep -v '^DTSTAMP:' >"$MH_TEST_DIR/test1.txt"
469 check
"$expected" "$MH_TEST_DIR/test1.txt"
472 # check accept of request with other -attendee
473 start_test
"accept of request with other -attendee"
474 cat >"$expected" <<'EOF'
477 PRODID:nmh mhical v0.5
480 TZID:Eastern Standard Time
482 DTSTART:16010101T020000
485 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
488 DTSTART:16010101T020000
491 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
495 ORGANIZER;CN=Requester:MAILTO:requester@example.com
496 ATTENDEE;PARTSTAT=ACCEPTED;CN=Requestee2:MAILTO:requestee2@example.com
497 SUMMARY;LANGUAGE=en-US:Accepted: test request
498 DTSTART;TZID=Eastern Standard Time:20150105T090000
499 DTEND;TZID=Eastern Standard Time:20150105T093000
506 LOCATION;LANGUAGE=en-US:
511 mhical
-reply accept
-attendee requestee2@example.com
<"$MH_TEST_DIR/test1.ics" \
512 | egrep -v '^DTSTAMP:' >"$MH_TEST_DIR/test1.txt"
513 check
"$expected" "$MH_TEST_DIR/test1.txt"
516 # check accept of request without required -attendee
517 start_test
"accept of request without required -attendee"
518 cat >"$expected" <<'EOF'
519 mhical: Multiple attendees match your address, re-run with -attendee switch
522 mhical
-reply accept
<"$MH_TEST_DIR/test1.ics" 2>"$MH_TEST_DIR/test1.txt" \
524 check
"$expected" "$MH_TEST_DIR/test1.txt"
525 mv "${MH}.save" "$MH"
528 # check accept of multiple vevent requests in single vcalendar
529 start_test
"accept of multiple vevent requests in single vcalendar"
530 cat >"$expected" <<'EOF'
533 PRODID:nmh mhical v0.5
536 TZID:Eastern Standard Time
538 DTSTART:16010101T020000
541 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
544 DTSTART:16010101T020000
547 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
551 ORGANIZER;CN=Requester:MAILTO:requester@example.com
552 ATTENDEE;PARTSTAT=ACCEPTED;CN=Requestee2:MAILTO:requestee2@example.com
553 SUMMARY;LANGUAGE=en-US:Accepted: test request
554 DTSTART;TZID=Eastern Standard Time:20150105T090000
555 DTEND;TZID=Eastern Standard Time:20150105T093000
562 LOCATION;LANGUAGE=en-US:
566 ORGANIZER;CN=Requester:MAILTO:requester@example.com
567 ATTENDEE;PARTSTAT=ACCEPTED;CN=Requestee2:MAILTO:requestee2@example.com
568 SUMMARY;LANGUAGE=en-US:Accepted: test request
569 DTSTART;TZID=Eastern Standard Time:20150105T130000
570 DTEND;TZID=Eastern Standard Time:20150105T134500
577 LOCATION;LANGUAGE=en-US:
582 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
589 TZID:Eastern Standard Time
591 DTSTART:16010101T020000
594 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
597 DTSTART:16010101T020000
600 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
605 ORGANIZER;CN=Requester:MAILTO:requester@example.com
606 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
607 :MAILTO:requestee1@example.com
608 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
609 :MAILTO:requestee2@example.com
610 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
611 :MAILTO:requestee3@example.com
612 SUMMARY;LANGUAGE=en-US:test request
613 DTSTART;TZID=Eastern Standard Time:20150105T090000
614 DTEND;TZID=Eastern Standard Time:20150105T093000
618 DTSTAMP:20150101T171600Z
622 LOCATION;LANGUAGE=en-US:
626 TRIGGER;RELATED=START:-PT15M
631 ORGANIZER;CN=Requester:MAILTO:requester@example.com
632 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
633 :MAILTO:requestee2@example.com
634 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
635 :MAILTO:requestee3@example.com
636 SUMMARY;LANGUAGE=en-US:test request
637 DTSTART;TZID=Eastern Standard Time:20150105T130000
638 DTEND;TZID=Eastern Standard Time:20150105T134500
642 DTSTAMP:20150101T171600Z
646 LOCATION;LANGUAGE=en-US:
650 TRIGGER;RELATED=START:-PT15M
657 mhical
-reply accept
<"$MH_TEST_DIR/test1.ics" | egrep -v '^DTSTAMP:' \
658 >"$MH_TEST_DIR/test1.txt"
659 check
"$expected" "$MH_TEST_DIR/test1.txt"
662 # check decline of request
663 start_test
"decline of request"
664 cat >"$expected" <<'EOF'
667 PRODID:nmh mhical v0.5
670 ORGANIZER;CN=Requester:MAILTO:requester@example.com
671 ATTENDEE;PARTSTAT=DECLINED;CN=Requestee2:MAILTO:requestee2@example.com
672 SUMMARY;LANGUAGE=en-US:Declined: test request
673 DTSTART:20150105T090000
674 DTEND:20150105T093000
681 LOCATION;LANGUAGE=en-US:
686 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
692 ORGANIZER;CN=Requester:MAILTO:requester@example.com
693 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
694 :MAILTO:requestee1@example.com
695 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
696 :MAILTO:requestee2@example.com
697 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
698 :MAILTO:requestee3@example.com
699 SUMMARY;LANGUAGE=en-US:test request
700 DTSTART:20150105T090000
701 DTEND:20150105T093000
705 DTSTAMP:20150101T171600Z
709 LOCATION;LANGUAGE=en-US:
713 TRIGGER;RELATED=START:-PT15M
719 mhical
-reply decline
<"$MH_TEST_DIR/test1.ics" | egrep -v '^DTSTAMP:' \
720 >"$MH_TEST_DIR/test1.txt"
721 check
"$expected" "$MH_TEST_DIR/test1.txt"
724 # check response of tentative to request, and -nocontenttype
725 start_test
"response of tentative to request, and -nocontenttype"
726 cat >"$expected" <<'EOF'
729 PRODID:nmh mhical v0.5
732 ORGANIZER;CN=Requester:MAILTO:requester@example.com
733 ATTENDEE;PARTSTAT=TENTATIVE;CN=Requestee2:MAILTO:requestee2@example.com
734 SUMMARY;LANGUAGE=en-US:Tentative: test request
735 DTSTART:20150105T090000
736 DTEND:20150105T093000
743 LOCATION;LANGUAGE=en-US:
748 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
754 ORGANIZER;CN=Requester:MAILTO:requester@example.com
755 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
756 :MAILTO:requestee1@example.com
757 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
758 :MAILTO:requestee2@example.com
759 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
760 :MAILTO:requestee3@example.com
761 SUMMARY;LANGUAGE=en-US:test request
762 DTSTART:20150105T090000
763 DTEND:20150105T093000
767 DTSTAMP:20150101T171600Z
771 LOCATION;LANGUAGE=en-US:
775 TRIGGER;RELATED=START:-PT15M
781 mhical
-reply tentative
-contenttype -nocontenttype \
782 -infile "$MH_TEST_DIR/test1.ics" | egrep -v '^DTSTAMP:' \
783 >"$MH_TEST_DIR/test1.txt"
784 check
"$expected" "$MH_TEST_DIR/test1.txt"
787 # check cancel request, and -contenttype
788 start_test
"cancel request, and -contenttype"
789 cat >"$expected" <<'EOF'
790 Content-Type: text/calendar; method="CANCEL"; charset="UTF-8"
794 PRODID:nmh mhical v0.5
797 ORGANIZER;CN=Requestee2:MAILTO:requestee2@example.com
798 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
799 :MAILTO:requestee1@example.com
800 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
801 :MAILTO:requestee3@example.com
802 SUMMARY;LANGUAGE=en-US:Cancelled:test request
803 DTSTART:20150105T090000
804 DTEND:20150105T093000
811 LOCATION;LANGUAGE=en-US:
816 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
822 ORGANIZER;CN=Requestee2:MAILTO:requestee2@example.com
823 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
824 :MAILTO:requestee1@example.com
825 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
826 :MAILTO:requestee3@example.com
827 SUMMARY;LANGUAGE=en-US:test request
828 DTSTART:20150105T090000
829 DTEND:20150105T093000
833 DTSTAMP:20150101T171600Z
837 LOCATION;LANGUAGE=en-US:
841 TRIGGER;RELATED=START:-PT15M
847 mhical
-cancel -contenttype <"$MH_TEST_DIR/test1.ics" | egrep -v '^DTSTAMP:' \
848 >"$MH_TEST_DIR/test1.txt"
849 check
"$expected" "$MH_TEST_DIR/test1.txt"
852 # Check TZID name wrapped with quotes, this used to cause a segfault.
853 start_test
"TZID name wrapped with quotes, this used to cause a segfault."
854 cat >"$expected" <<'EOF'
856 Summary: Quoted timezone ID
857 At: Wed, 01 Jan 2014 00:00
858 To: Wed, 01 Jan 2014 01:00
861 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
863 PRODID:Zimbra-Calendar-Provider
866 SUMMARY:Quoted timezone ID
870 DTSTART:19710101T000000
877 DTSTART:20140101T000000
878 DTEND;TZID="Etc/GMT":20140101T010000
884 TZ
=UTC mhical
<"$MH_TEST_DIR/test1.ics" >"$MH_TEST_DIR/test1.txt"
885 check
"$expected" "$MH_TEST_DIR/test1.txt"
888 # Check start datetime without a time, and missing end datetime.
889 start_test
"start datetime without a time, and missing end datetime."
890 cat >"$expected" <<'EOF'
892 Summary: Test datetime without time
893 At: Wed, 30 Dec 2015 00:00
894 To: Wed, 30 Dec 2015 23:59
897 cat >"$MH_TEST_DIR/test1.ics" <<'EOF'
900 PRODID:icalendar-ruby
904 DTSTAMP:20151208T204350Z
906 DTSTART;VALUE=DATE:20151230
908 SUMMARY:Test datetime without time
912 TRIGGER;RELATED=START:-PT15M
918 TZ
=UTC mhical
<"$MH_TEST_DIR/test1.ics" >"$MH_TEST_DIR/test1.txt"
919 check
"$expected" "$MH_TEST_DIR/test1.txt"
920 rm -f "$MH_TEST_DIR/test1.ics"
923 # check missing final newline
924 start_test
"missing final newline"
926 cat >"$expected" <<'EOF'
928 Description: this file does not end with a newline
929 At: Sun, 14 May 2017 13:00 +0000
930 To: Sun, 14 May 2017 14:00
938 DTSTAMP:20170514T122300Z
939 DTSTART:20170514T130000Z
940 DTEND:20170514T140000Z
942 DESCRIPTION:this file does not end with a newline
944 END:VCALENDAR" | TZ
=UTC mhical
>"$actual"
945 check
"$expected" "$actual"
948 # check invalid line folding
949 start_test
"invalid line folding"
951 cat >"$expected" <<'EOF'
953 Description: this file does not end with a newline
954 At: Sun, 14 May 2017 13:00 +0000
955 To: Sun, 14 May 2017 14:00
958 cat >"$expected_err" <<'EOF'
959 mhical: syntax error, unexpected ICAL_COMMA, expecting ICAL_COLON after " this line is not folded"
966 PRODID:-//TDP v3.0//EN
968 DTSTAMP:20170514T122300Z
969 DTSTART:20170514T130000Z
970 DTEND:20170514T140000Z
972 DESCRIPTION:this file does not end with a newline
973 and this line is not folded,
975 END:VCALENDAR" | TZ
=UTC mhical
>"$actual" 2>"$actual_err"
977 check
"$expected" "$actual"
978 check
"$expected_err" "$actual_err"
982 start_test
"null input"
983 check_exit
'-eq 0' mhical
</dev
/null