aboutsummaryrefslogtreecommitdiffstats
path: root/test/recur-010.sh
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-10-13 22:39:04 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2020-04-28 07:32:44 -0400
commiteda28d3fef5a2a841fa41c620fc976ce11d824b1 (patch)
tree31d4b1fea61b770efbfb95723519627cc98bb1a1 /test/recur-010.sh
parentdd864316c671e28b4979c9365b59acc3a9a2d031 (diff)
downloadcalcurse-eda28d3fef5a2a841fa41c620fc976ce11d824b1.tar.gz
calcurse-eda28d3fef5a2a841fa41c620fc976ce11d824b1.zip
Tests for recurrence rule extensions
Test cases include all the examples from RFC5545 which are supported. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'test/recur-010.sh')
-rwxr-xr-xtest/recur-010.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/recur-010.sh b/test/recur-010.sh
new file mode 100755
index 0000000..5567a40
--- /dev/null
+++ b/test/recur-010.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Calcurse support of recurrence rules does not include the rule part WKST (weekstart),
+# but calcurse configuration does allow a choice between Monday and Sunday.
+
+. "${TEST_INIT:-./test-init.sh}"
+
+if [ "$1" = 'actual' ]; then
+ TMP=tmp
+ mkdir "$TMP"
+ cp "$DATA_DIR"/conf "$TMP"
+ sed -n '/page 131/p' "$DATA_DIR"/rfc5545 > "$TMP"/apts
+ "$CALCURSE" -D "$TMP" -Q --filter-type cal --startday=08/01/1997 --range=31
+ sed 's/=monday/=sunday/' "$DATA_DIR"/conf > "$TMP"/conf
+ "$CALCURSE" -D "$TMP" -Q --filter-type cal --startday=08/01/1997 --range=31
+ rm -rf "$TMP"
+elif [ "$1" = 'expected' ]; then
+ cat <<EOD
+08/05/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+
+08/10/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+
+08/19/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+
+08/24/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+08/05/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+
+08/17/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+
+08/19/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+
+08/31/97:
+ - 09:00 -> 09:00
+ page 131: An example where the days generated makes a difference because of weekstart (RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU)
+EOD
+else
+ ./run-test "$0"
+fi