diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-01-21 15:28:51 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-01-22 00:13:35 +0100 |
commit | 32530f0e50ba5cd4e3259f8f1868e28ae375ef20 (patch) | |
tree | 6881ac69392cdb55698d38d3792d3c6dc269fdb5 /test/todo-001.sh | |
parent | 31b4c71eb2610471cb0598338f510633f407477f (diff) | |
download | calcurse-32530f0e50ba5cd4e3259f8f1868e28ae375ef20.zip |
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>
Diffstat (limited to 'test/todo-001.sh')
-rwxr-xr-x | test/todo-001.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/todo-001.sh b/test/todo-001.sh new file mode 100755 index 0000000..f607b30 --- /dev/null +++ b/test/todo-001.sh @@ -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 |