From 2f1fdbb13175535e4b52f75616cbaf11a81181d3 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Sat, 6 Jun 2020 20:52:43 +0200 Subject: partial fix for https://github.com/tobixen/calendar-cli/issues/11 - fix TZ when adding events. (agenda is still fubarred when caldav server yields timezone information) --- tests/tests.sh | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'tests/tests.sh') diff --git a/tests/tests.sh b/tests/tests.sh index 9718709..4ab51e8 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -94,8 +94,35 @@ echo "$output" | grep -q "20101013" || error "could not find the date" echo "$output" | grep -q "20101013T" && error "a supposed whole day event was found to be with the time of day" echo "OK: found the event" +echo "## cleanup, delete it" +calendar_cli calendar delete --event-uid=$uid + +echo "## testing timezone support" +echo "## Create a UTC event" +calendar_cli --timezone='UTC' calendar add '2010-10-09 12:00:00+2h' 'testevent with a UTC timezone' +uid=$(echo $output | perl -ne '/uid=(.*)$/ && print $1') +[ -n "$uid" ] || error "got no UID back" + +echo "## fetching the UTC-event, as ical data" +calendar_cli --icalendar calendar agenda --from-time=2010-10-08 --agenda-days=3 +echo "$output" | grep -q "20101009T120000Z" || error "failed to find the UTC timestamp. Perhaps the server is yielding timezone data for the UTC timezone? In that case, the assert in the test code should be adjusted" + +echo "## cleanup, delete it" +calendar_cli calendar delete --event-uid=$uid + +echo "## Create an event with a somewhat remote time zone, west of UTC" +calendar_cli --timezone='Brazil/DeNoronha' calendar add '2010-10-09 12:00:00+2h' 'testevent with a time zone west of UTC' +uid=$(echo $output | perl -ne '/uid=(.*)$/ && print $1') +[ -n "$uid" ] || error "got no UID back" + +echo "## fetching the UTC-event, as ical data" +calendar_cli --icalendar calendar agenda --from-time=2010-10-08 --agenda-days=3 +echo "$output" | grep -q "TZID=Brazil" || error "failed to find the Brazilian timezone. perhaps the server is yielding an UTC timestamp? In that case, the assert in the test code should be adjusted." + +echo "## cleanup, delete it" +calendar_cli calendar delete --event-uid=$uid -## TODOS / TASK LISTS +echo "## TODOS / TASK LISTS" echo "## Attempting to add a task with category 'scripttest'" calendar_cli todo add --set-categories scripttest "edit this task" -- cgit v1.2.3