calcurse-edge/test/next-001.sh
Lukas Fleischer 2ea91e1a8a test/: Use faketime -f
Use the advanced timestamp specification format for libfaketime.

Before using that, some tests failed on 32-bit systems due to integer
overflows. It seems like faketime translates absolute dates to relative
dates by default. Moreover, libfaketime is not able to handle relative
dates that exceed the maximum value of a signed integer. Using "-f"
skips the conversion to relative dates.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-12-22 01:09:17 +01:00

18 lines
361 B
Bash
Executable File

#!/bin/sh
if [ ! -x "$(command -v faketime)" ]; then
echo "libfaketime not found - skipping $0..."
exit 0
fi
if [ "$1" = 'actual' ]; then
faketime -f '1912-07-10 04:10:00' "$CALCURSE" --read-only -D "$DATA_DIR" -n
elif [ "$1" = 'expected' ]; then
cat <<EOD
next appointment:
[13:37] Impersonating integer broils blame
EOD
else
./run-test "$0"
fi