test/: Add test cases for "-a" and "-n"

* appointment-001.sh: Compare output of "-a" with hardcoded data.
* next-001.sh: Compare output of "-n" with hardcoded data.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-01-22 16:39:00 +01:00
parent dbb19b7c25
commit cb69a4c087
3 changed files with 39 additions and 1 deletions

View File

@ -12,7 +12,9 @@ TESTS = \
day-003.sh \
range-001.sh \
range-002.sh \
range-003.sh
range-003.sh \
appointment-001.sh \
next-001.sh
check_PROGRAMS = run-test
check_SCRIPTS = $(TESTS)

19
test/appointment-001.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
if [ ! -x "$(command -v faketime)" ]; then
echo "libfaketime not found - skipping $0..."
exit 1
fi
if [ "$1" = 'actual' ]; then
faketime '2011-02-25 23:42' calcurse -D data -a
elif [ "$1" = 'expected' ]; then
cat <<EOD
02/25/11:
* Socket ghastlier
- ..:.. -> ..:..
Covenants useful smoker's
EOD
else
./run-test "$0"
fi

17
test/next-001.sh Executable file
View File

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