test/: Add generic tests for todo operations

* todo-001.sh: Tests the "-t" command line option (calculates expected
  output by parsing the todo data file).

* todo-002.sh: Tests "-t<num>" in a way similar to todo-001.sh.

* todo-003.sh: Tests "-t0" in a way similar to todo-001.sh.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-01-21 15:28:51 +01:00
parent 31b4c71eb2
commit 32530f0e50
5 changed files with 235 additions and 1 deletions

12
test/todo-001.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
if [ "$1" = 'actual' ]; then
calcurse -D data/ -t | sort
elif [ "$1" = 'expected' ]; then
(
echo 'to do:'
sed '/^\[-/d; s/^\[\([0-9]\)\] \(.*\)/\1. \2/' data/todo
) | sort
else
./run-test "$0"
fi