aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-06-25 20:38:43 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-09-06 18:17:23 -0400
commit1db1108e86ff41a5efc7268145a092fc36418d63 (patch)
treee744d67c985611659224055aa4fe5b20f92251ea /test
parent2ae30b223ecf79f92bf81af934c40dd645be274c (diff)
downloadcalcurse-1db1108e86ff41a5efc7268145a092fc36418d63.tar.gz
calcurse-1db1108e86ff41a5efc7268145a092fc36418d63.zip
Test cases for "Fix monthly and yearly recurrence algorithms"
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am3
-rw-r--r--test/data/apts-recur2
-rwxr-xr-xtest/recur-007.sh31
3 files changed, 35 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 12998c9..75ef72d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -61,7 +61,8 @@ TESTS = \
recur-003.sh \
recur-004.sh \
recur-005.sh \
- recur-006.sh
+ recur-006.sh \
+ recur-007.sh
TESTS_ENVIRONMENT = \
TEST_INIT='$(top_srcdir)/test/test-init.sh' \
diff --git a/test/data/apts-recur b/test/data/apts-recur
index 6c08da0..ba48a89 100644
--- a/test/data/apts-recur
+++ b/test/data/apts-recur
@@ -12,3 +12,5 @@
01/01/2000 @ 00:00 -> 01/07/2000 @ 00:00 {1D} |Third recurrent appointment
05/31/2019 @ 07:25 -> 05/31/2019 @ 07:45 {1M} |Ignore impossible dates
02/29/2020 [1] {1Y} Every 29 February since 2020
+12/31/2019 @ 12:00 -> 01/01/2020 @ 12:00 {2Y -> 2/1/2020} |new year
+04/30/2019 @ 12:00 -> 05/01/2019 @ 11:00 {2M -> 5/2/2019} |change of month
diff --git a/test/recur-007.sh b/test/recur-007.sh
new file mode 100755
index 0000000..73dea6f
--- /dev/null
+++ b/test/recur-007.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. "${TEST_INIT:-./test-init.sh}"
+
+if [ "$1" = 'actual' ]; then
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-recur" \
+ --startday=12/31/2019 --range=2 --filter-type recur-apt \
+ --filter-pattern 'new'
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-recur" \
+ --startday=4/30/2019 --range=2 --filter-type recur-apt \
+ --filter-pattern 'of'
+elif [ "$1" = 'expected' ]; then
+ cat <<EOD
+12/31/19:
+ - 12:00 -> ..:..
+ new year
+
+01/01/20:
+ - ..:.. -> 12:00
+ new year
+04/30/19:
+ - 12:00 -> ..:..
+ change of month
+
+05/01/19:
+ - ..:.. -> 11:00
+ change of month
+EOD
+else
+ ./run-test "$0"
+fi