summaryrefslogtreecommitdiff
path: root/test/todo-003.sh
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-01-21 15:28:51 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-01-22 00:13:35 +0100
commit32530f0e50ba5cd4e3259f8f1868e28ae375ef20 (patch)
tree6881ac69392cdb55698d38d3792d3c6dc269fdb5 /test/todo-003.sh
parent31b4c71eb2610471cb0598338f510633f407477f (diff)
downloadcalcurse-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-003.sh')
-rwxr-xr-xtest/todo-003.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/todo-003.sh b/test/todo-003.sh
new file mode 100755
index 0000000..ecec032
--- /dev/null
+++ b/test/todo-003.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = 'actual' ]; then
+ calcurse -D data/ -t0 | sort -n
+elif [ "$1" = 'expected' ]; then
+ (
+ echo 'completed tasks:'
+ sed -n 's/^\[-\([0-9]\)\] \(.*\)/\1. \2/p' data/todo
+ ) | sort -n
+else
+ ./run-test "$0"
+fi