summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-03-27 12:54:10 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2016-03-27 13:06:18 +0200
commit9e160fac16e81c42ac368f450b9cc4df29753e00 (patch)
tree9fe79f9b549f840b0d93cdfd79554e32f8e62dc1 /test
parente1b6d226692ddaa8a9f077796a23317d36cd5d10 (diff)
downloadcalcurse-9e160fac16e81c42ac368f450b9cc4df29753e00.tar.gz
calcurse-9e160fac16e81c42ac368f450b9cc4df29753e00.zip
Do not assume that days always have 86400 seconds
Make that date membership is computed correctly, even if a day has less than 86400 seconds (e.g. after changing clocks). Reported-by: Hakan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am2
-rw-r--r--test/data/apts-regress-0011
-rwxr-xr-xtest/regress-001.sh15
3 files changed, 18 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index efc3d12..f8d6088 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -52,6 +52,7 @@ TESTS = \
next-001.sh \
search-001.sh \
bug-002.sh \
+ regress-001.sh \
recur-001.sh \
recur-002.sh \
recur-003.sh \
@@ -105,6 +106,7 @@ EXTRA_DIST = \
data/apts-event-006 \
data/apts-filter-001 \
data/apts-recur \
+ data/apts-regress-001 \
data/conf \
data/ical-001.ical \
data/ical-002.ical \
diff --git a/test/data/apts-regress-001 b/test/data/apts-regress-001
new file mode 100644
index 0000000..8eaae31
--- /dev/null
+++ b/test/data/apts-regress-001
@@ -0,0 +1 @@
+03/28/2016 [1] Day after clock adjustment
diff --git a/test/regress-001.sh b/test/regress-001.sh
new file mode 100755
index 0000000..3ad6deb
--- /dev/null
+++ b/test/regress-001.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. "${TEST_INIT:-./test-init.sh}"
+
+if [ "$1" = 'actual' ]; then
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-regress-001" \
+ -Q --filter-type=cal --from=2016-03-27 --days=2
+elif [ "$1" = 'expected' ]; then
+ cat <<EOD
+03/28/16:
+ * Day after clock adjustment
+EOD
+else
+ ./run-test "$0"
+fi