summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2015-01-19 23:47:55 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2015-02-07 09:52:36 +0100
commita12833ec086d5e0d35eac04f7e3c386879beccc0 (patch)
tree6e652ed622cacf90adfe7e7d577947249dbca3f5 /test
parent4fd8f0b11e565587f349b910b3abfd16b611e767 (diff)
downloadcalcurse-a12833ec086d5e0d35eac04f7e3c386879beccc0.tar.gz
calcurse-a12833ec086d5e0d35eac04f7e3c386879beccc0.zip
Handle dates past January 19th, 2038
Try to support dates past year 2038 on systems with 64-bit time_t. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'test')
-rw-r--r--test/data/apts-y2k38-0014
-rwxr-xr-xtest/y2k38-001.sh27
2 files changed, 31 insertions, 0 deletions
diff --git a/test/data/apts-y2k38-001 b/test/data/apts-y2k38-001
new file mode 100644
index 0000000..bf6d664
--- /dev/null
+++ b/test/data/apts-y2k38-001
@@ -0,0 +1,4 @@
+01/19/2038 [1] Event 1
+01/20/2038 [1] Event 2
+01/01/2100 [1] Event 3
+01/01/9999 [1] Event 4
diff --git a/test/y2k38-001.sh b/test/y2k38-001.sh
new file mode 100755
index 0000000..5243ea6
--- /dev/null
+++ b/test/y2k38-001.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. "${TEST_INIT:-./test-init.sh}"
+
+if [ "$1" = 'actual' ]; then
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
+ -d01/19/2038
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
+ -d01/20/2038
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
+ -d01/01/2100
+ "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
+ -d01/01/9999
+elif [ "$1" = 'expected' ]; then
+ cat <<EOD
+01/19/38:
+ * Event 1
+01/20/38:
+ * Event 2
+01/01/00:
+ * Event 3
+01/01/99:
+ * Event 4
+EOD
+else
+ ./run-test "$0"
+fi